Linux: How to forward system emails

This post is over 3 years old, so please keep in mind that some of its content might not be relevant anymore.

Every time Linux generates a system email it sends it to the root user.
I don't normally check that email so I needed to send it to another email address.
The simplest way I found to do this is creating a hidden file called ".forward" in /root/ and add my email address to it. Nothing else!

If you want to receive another user's email instead you can do the same in their home.
Create the file "/home/anyuser/.forward" and add your email.
Easy!

NB: Make sure your system can actually send emails to other domains. You might want to have a look on how to set up sendmail as a smart host

Leave a Reply

Your email address will not be published.