email - How to use an alias while sending mail on linux? -
i have shell script sends out mail @ end of processing status. using command -
mail -s "mail_subject" "tom@my_domain.com" < "mail_text"
this mail being sent email id user@<machine_name>.my_domain.local.
is possible use alias while sending these mails ?
something process.name@my_domain.com?
if yes how ?
some versions of mail have options this, not universally portable. if needs simple, write own sendmail wrapper.
cat - mail_text << ____here | sendmail -oi tom@example.com from: alias <process-noeeply@example.com> subject: mail_subject ____here the empty line after headers significant. sendmail fill in (what thinks are) sensible defaults headers don't specify.
it doesn't have proper sendmail; mtas ship "sendmail" binary (more or less) supports traditional sendmail command-line api.
if need mime or other bells , whistles, maybe @ mutt instead.
Comments
Post a Comment