Many system services and automated jobs (cron) are setup to send notifications the root email account for the server by default. If you need a way to quickly capture the root email and redirect them to another account, the quick steps below will get this taken care of.
First step is to edit your aliases file located at /etc/aliases using a text editor on your server. Personally I like to use pico/nano. You will need to add the following line to this file:
root: [email protected] (replace [email protected] with your real email address)
Next step after saving the aliases file is to let the server know you have new aliases. This can be done by simply running the newaliases command.
You can test to see if your change is working by running the following command which will send a test email.
echo test | mail -s "test message" root
With that your root email will now go to the email account you defined in the aliases file. These same steps can be performed for any accounts on the server.