How to specify where root email goes

Your server sends out a lot of email to user root. For example, CSF (ConfigServer Security & Firewall) sends out most security notifications to root.

So, this is how we specify what email address root emails go to:

vi /etc/aliases

Scroll to the bottom,  and add or replace  existing:

root: [email protected]

Save and exit, then reload the aliases:

newaliases

Another option is to create a ~/.forward file and put your email address in it.

Example: Say I'm logged in as root.

vi ~/.forward

This will create (or edit an exising) file:

/root/.forward

Next we add the email address we want root emails forwarded to:

[email protected] 

Now restart exim.

service exim restart

And that should do it. 

BTW, you may want to think about what email address you'll use for this, as you'll likely start receiving a ton of emails.