Derek Neely

...notes for thyself, but useful for all...

Prevent Postfix from sending root email outbound


Jan 13, 2017 by derek

We recently noticed an issue where Postfix was sending our system's root emails outbound to root@ourhost.com. Our mail relay was not delivering these, but they should have been delivered locally and not going out of the system in the first place. The issue had to do with the fact that our server's Postfix was configured with:

myorigin = myhost.com

All in all this was a quick fix to handle. Just need to add a new config directive. Add the config file and enable it.

Edit /etc/postfix/main.cf and add the following line (I added mine just below the other 'alias' configs):

virtual_alias_maps = hash:/etc/postfix/virtual

Now, edit this file we're referencing (/etc/postfix/virtual) and add the following line:

root     root@localhost

Run postmap on this file:

$ postmap /etc/postfix/virtual

Then for good measure, bounce Postfix:

$ service postfix restart

Social


Tweet Tweet Tweet


© 2016 Derek Neely