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

1

20

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 [email protected] 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 [email protected] to [email protected]?

Furnivall answered 2/3, 2012 at 18:55 Comment(1)
You would probably get a better response if you ask this on superuser.com which is one of StackOverflow's many sister sites - and more tailored to your question.Luz
B
40

You can use the smtp_generic_maps of postfix to rewrite email headers for outgoing smtp mail:

user:~$ echo "[email protected]  [email protected]" >> /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
Bujumbura answered 28/3, 2012 at 12:0 Comment(4)
echo "[email protected] [email protected]" >> /etc/postfix/generic might be easier for many to read.Brittaniebrittany
@Bujumbura What about also overriding sender name? It works but send email as "[email protected](root)". Almost there, but not quiteBoiler
"postmap: warning: /etc/postfix/generic, line 1: expected format: key whitespace value"Pidgin
You can also skip the command postmap /etc/postfix/generic and tell main.cf that you use a texthash instead of a hash: echo "smtp_generic_maps = texthash:/etc/postfix/generic" >> /etc/postfix/main.cfEthylethylate

© 2022 - 2024 — McMap. All rights reserved.