如何更改后缀的默认电子邮件地址? [英] how to change default email address for postfix?
问题描述
我有一个运行python,php,perl,ruby的服务器,并且我还有几个也会发送邮件的应用程序.我想知道是否其中一个应用程序未指定发件人电子邮件地址,发件人电子邮件地址设置为http@example.com
,发件人名称为"http".
I have a server running python, php, perl, ruby, and I have couple applications which also send mail. I was wondering in case if one of the applications don't specify a from email address, the sender email address is set to http@example.com
and the sender name was "http".
我可以通过进入/etc/passwd
并将其更改为所需的名称来更改发件人名称,但是如何将http@example.com
更改为admin@example.com
?
I was able change the sender name by going into /etc/passwd
and changing the name to what I wanted, but how do I change http@example.com
to admin@example.com
?
推荐答案
您可以使用 smtp_generic_maps 重写外发smtp邮件的电子邮件标头:
You can use the smtp_generic_maps of postfix to rewrite email headers for outgoing smtp mail:
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
这篇关于如何更改后缀的默认电子邮件地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!