how to change default email address for postfix? [closed]

戏子无情 提交于 2019-12-03 04:58:08

问题


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".

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?


回答1:


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


来源:https://stackoverflow.com/questions/9538817/how-to-change-default-email-address-for-postfix

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!