Route local emails to another email address using Postfix on Linux
When I set up new servers, I like to make sure any system messages like cron failures, server issues, or emails that are routed to [email protected]
(where 'example.com' is the hostname of the server—meaning emails to that domain will get routed through the server itself and not hit an external MX server unless postfix/sendmail is configured correctly) are sent to my own email address.
It's relatively straightforward to route emails to internal users (like webmaster
, root
, etc.) to an external email address; you simply need to edit the /etc/aliases
file, adding a rule like the one below, then run the command sudo newaliases
:
<br />
webmaster: root
# Person who should get root's mail
root: [email protected]