Skip to main content

Can I change root's email address or forward it to an external address? [Resolved]

I'm getting a lot of mail in my root user's mail account. This appears to be mostly reports and errors from things like cron scripts. I'm trying to work though and solve these things, possibly even have them be piped to some sort of "dashboard" - but until then how can I have these messages go to my personal e-mail account instead?

Question Credit: cwd
Question Reference
Asked July 20, 2019
Posted Under: Unix Linux
5 Answers

Any user, including root, can forward their local email by putting the forwarding address in a file called ~/.forward. You can have multiple addresses there, all on one line and separated by comma. If you want both local delivery and forwarding, put root@localhost as one of the addresses.

The system administrator can define email aliases in the file /etc/aliases. This file contains lines like root:, /root/mailbox; the effect is the same as having, /root/mailbox in ~root/.forward. You may need to run a program such as newaliases after changing /etc/aliases.

Note that the workings of .forward and /etc/aliases depend on your MTA. Most MTAs implement the main features provided by the traditional sendmail, but check your MTA's documentation.

credit: Gilles
Answered July 20, 2019

in ~/.forward,

with this I get an email on my box and it is also written to /var/mail/root. (my distribution is Debian with postfix).
Replace "" with the domain name of your server

credit: zoechi
Answered July 20, 2019

Use this command:

nano /root/.forward 

Insert, edit or remove emails in that text file, Ctrl+X, [Y] to save file.

credit: G-Man
Answered July 20, 2019

If you are using the Postfix MTA and own your own domain (, you can configure it to forward to alongside any other user account.

In the configuration file, or with the overrides in set the following options:

mydomain =
mydestination = localhost.localdomain, localhost, local.$mydomain # Basically, anything but $mydomain

This will have Postfix treat mail to your root account as and route it accordingly, whether relay to your relayhost or deliver it to directly. With this configuration Postfix will deliver mail to to your local mailbox (/var/mail/root or wherever your system delivers system mail).

credit: palswim
Answered July 20, 2019
Your Answer