Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
You should ask your second question as a separate question if you really want an answer to it. – cjm Dec 13 '11 at 8:40
up vote 38 down vote accepted

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: cwd@mailhost.example.com, /root/mailbox; the effect is the same as having cwd@mailhost.example.com, /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.

share|improve this answer
hmm, does cwd@mailhost.example.com, /root/mailbox work on ubuntu? it goes to the first address but not the local mailbox for root, even after running newaliases. I also tried /var/mail/root without success... – cwd Dec 14 '11 at 1:37
@cwd It does for Postfix. Hmm, I think recent versions of Ubuntu install a limited MTA which doesn't do any local delivery in the default desktop installation. Older Ubuntu releases or server installations install Postfix by default, and Postfix does support my examples. – Gilles Dec 14 '11 at 10:07
Thanks. I think root's .forward file may have been overriding the multiple addresses I had in the alias file. It's working now, thanks for your help :) – cwd Dec 14 '11 at 14:20
What permissions should the file have? – Thomas Weller Nov 30 '15 at 21:59
@ThomasWeller Which file? /etc/aliases and ~/.forward are usually 644, though I think 600 works with most MTAs. – Gilles Nov 30 '15 at 22:09

Simply create /root/.forward and place your email address in this file. It will be forwarded to your external mail address.

share|improve this answer

in .forward myaddress@example.com, root@thisserver.com

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 "thisserver.com" with the domain name of your server

share|improve this answer

Use this command:

nano /root/.forward 

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.