【问题标题】:Change sendmail sender using bash使用 bash 更改 sendmail 发件人
【发布时间】:2011-11-18 05:07:02
【问题描述】:

运行 sendmail 命令,我通常会收到带有 username@hostname 之类的发件人的电子邮件。

有没有办法使用 sendmail 发送电子邮件,并将发件人设置为与用于运行命令的用户帐户不同的内容?

【问题讨论】:

    标签: bash sendmail


    【解决方案1】:

    你要找的是-f:

    sendmail -F "Your name" -f "your-address@example.com" < your-message.txt
    

    来自sendmail man page

     -Ffullname  Set the full name of the sender.
    
     -fname      Sets the name of the ``from'' person (i.e., the sender of the
                 mail).  -f can only be used by ``trusted'' users (normally
                 root, daemon, and network) or if the person you are trying to
                 become is the same as the person you are.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-12-02
      • 2010-11-22
      • 2020-05-20
      • 2019-04-06
      • 2023-04-05
      • 2014-12-10
      • 1970-01-01
      相关资源
      最近更新 更多