#include <stddisclaimer.h>
Pros: Easy access to any email sent to root@localhost
Cons: None that I can think of.
Let us begin: To put it simply, a lot of important mail may be sent to you from your local software to root@localhost. Usually, to read it, you would need to read the contents of /var/spool/mail/root, which is a real hassle to some people, myself included. So I decided to find out how to relay everything sent to it to my main email address, and ended up with this.
Before we start, make sure you are able to mail from command line using the "mail" utility. Try sending yourself an email:
[Gleb@localhost Gleb]$ mail gleb@belg88.com(press enter)
Subject: Testing (press enter)
Testing(press enter)
(press control+d)
Cc:(press enter)
You should get an email in your inbox shortly. If you don't, make sure you have sendmail installed (check to see if /usr/sbin/sendmail exists).
Assuming you are root, create a file called ".forward" and insert the line "root:you@domain.com":
[Gleb@localhost Gleb]$ touch .forward
[Gleb@localhost Gleb]$ echo root:you@domain.com > .forward
Chmod it to 0755:
[Gleb@localhost Gleb]$ chmod 0755 .forward
[Gleb@localhost Gleb]$ ls -la .forward
-rwxr-xr-x 1 Gleb Gleb 30 Feb 11 22:11 .forward
And you're done! All mail sent to root@localhost should now relay into your usual email account.
Also, the same can be done for other emails, such as user1@localhost, by inserting a ".forward" file in their home directories and making the obvious changes.


