【问题标题】:How to change the default from address of email send by Linux root如何更改 Linux root 发送的电子邮件地址的默认值
【发布时间】:2013-07-12 09:13:43
【问题描述】:

我将 sendmail 与 Amazon SES 一起使用。它适用于仅经过验证的电子邮件地址。

  1. 所以首先我想知道 root 何时运行 cron 作业,然后它使用哪个电子邮件地址来自

  2. 如何更改该电子邮件地址

【问题讨论】:

    标签: linux centos sendmail root


    【解决方案1】:

    您应该能够使用 sendmail 命令的 -f 标志来指定信封发件人地址,并且您应该能够在邮件本身的标题中指定发件人地址的消息。例如:

    /usr/sbin/sendmail -f from@from.com to@to.com

    【讨论】:

    • 但我的问题是当 linux cron 发送电子邮件时,我无法更改发件人电子邮件地址
    • 好的,试试这个,在你的 crontab 中: * * * * * some_cronjob_goes_here 2>&1 | /usr/sbin/sendmail -s "这里的邮件主题" recipient@mydomain.com -f sender@mydomain.com
    • 或者,如果是 Centos6,你可以在你的 crontab 中输入以下内容: MAILFROM=sender@mydomain.com MAILTO=recipient@mydomain.com
    猜你喜欢
    • 2014-04-30
    • 2012-03-21
    • 1970-01-01
    • 1970-01-01
    • 2019-01-06
    • 2018-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多