【问题标题】:how to change default email address for postfix? [closed]如何更改后缀的默认电子邮件地址? [关闭]
【发布时间】:2012-03-21 06:46:15
【问题描述】:

我有一个运行 python、php、perl、ruby 的服务器,并且我有几个应用程序也可以发送邮件。我想知道如果其中一个应用程序没有指定发件人电子邮件地址,发件人电子邮件地址设置为http@example.com,发件人名称为“http”。

我可以通过进入 /etc/passwd 并将名称更改为我想要的名称来更改发件人姓名,但是如何将 http@example.com 更改为 admin@example.com

【问题讨论】:

  • 如果您在 superuser.com 这是 StackOverflow 的众多姊妹网站之一,并且更适合您的问题,您可能会得到更好的答复。

标签: postfix-mta


【解决方案1】:

您可以使用后缀的smtp_generic_maps 来重写外发smtp 邮件的邮件头:

user:~$ echo "http@example.com  admin@example.com" >> /etc/postfix/generic 
user:~$ echo "smtp_generic_maps = hash:/etc/postfix/generic" >> /etc/postfix/main.cf
user:~$ postmap /etc/postfix/generic
user:~$ service postfix restart

【讨论】:

  • echo "http@example.com admin@example.com" >> /etc/postfix/generic 对许多人来说可能更容易阅读。
  • @knittl 还覆盖发件人姓名怎么样?它可以工作,但以“fromme@example.com(root)”的身份发送电子邮件。快到了,但还不够
  • "postmap:警告:/etc/postfix/generic,第 1 行:预期格式:键空白值"
  • 你也可以跳过命令postmap /etc/postfix/generic,告诉main.cf你使用texthash而不是hashecho "smtp_generic_maps = texthash:/etc/postfix/generic" >> /etc/postfix/main.cf
猜你喜欢
  • 2011-06-07
  • 1970-01-01
  • 2018-11-12
  • 1970-01-01
  • 2019-01-06
  • 2014-04-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多