Difference between revisions of "Masquerade email address"

From Amahi Wiki
Jump to: navigation, search
Line 9: Line 9:
 
{{text|root        admin@yourisp.com
 
{{text|root        admin@yourisp.com
 
logwatch    logwatch@yourisp.com}}
 
logwatch    logwatch@yourisp.com}}
 +
  
 
* Create /etc/postfix/sender_canonical.db file:
 
* Create /etc/postfix/sender_canonical.db file:

Revision as of 02:04, 25 November 2013

If you have followed Outgoing main via Gmail or Enable Outgoing Emails tutorial, you will notice that the sending email address is not properly formed. For example, it appears as root@hda.amahi.net vs root@amahi.net. This can be easily changed with a minor update to Postfix.

You can force Postfix to send local emails with your preferred email address as the "sender" header. This means that when you send mails using "mail" or mails automatically sent by root,you can get your email at the from field.

bash code
​vi /etc/postfix/sender_canonical​


  • Create the /etc/postfix/sender_canonical, and add user -> email references like this:
Text
​root admin@yourisp.com logwatch logwatch@yourisp.com​


  • Create /etc/postfix/sender_canonical.db file:
bash code
​postmap hash:/etc/postfix/sender_canonical​


  • Add sender_canonical variable to /etc/postfix/main.cf:
bash code
​postconf -e "sender_canonical_maps=hash:/etc/postfix/sender_canonical"


  • Restart postfix:
bash code
​systemctl restart postfix.service​


REF: Make Postfix rewrite sender header on local mails