Mini Howoto: Forwarding root@localhost to your main email

Place to discuss Fedora and/or Red Hat
Post Reply
TheQuirk
programmer
programmer
Posts: 113
Joined: Wed Jan 22, 2003 4:11 pm

Mini Howoto: Forwarding root@localhost to your main email

Post by TheQuirk » Tue Feb 11, 2003 10:15 pm

#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.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Feb 11, 2003 10:27 pm

I usually add a line to /etc/aliases:

Code: Select all

root:  voidmain


or if you have more than one admin:

Code: Select all

root: voidmain gleb@somewhere.com x11@aussieland.com


And then do a:

# newaliases

But the best thing to do is set up a generic account on a main email server called "unixmail" or something similar and then every one of your servers would have one alias that never needs changing:

Code: Select all

root: unixmail@somewhere.com


Then on the main mail server you set the "unixmail" mail account to forward to all of your admins. Then you only have one place to change whenever you hire/fire an admin.

Good tip, root mail is something overlooked by many bad admins. I've seen many a machines with root mailboxes bulging at the seams that haven't been looked at in years.

TheQuirk
programmer
programmer
Posts: 113
Joined: Wed Jan 22, 2003 4:11 pm

Post by TheQuirk » Tue Feb 11, 2003 11:01 pm

I am proven wrong once again! :)

BTW, is that nVidia one going into the tips page?

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Feb 11, 2003 11:40 pm

I didn't prove you wrong, just gave an alternate way to do it.

Regarding the nVidia instructions. I believe I mentioned before that I am very reluctant to put the nVidia HOWTO out there because I believe the instructions on nVidia's site are the best instructions available, and extremely easy to follow:

http://www.nvidia.com/view.asp?IO=linux ... 2_1.0-4191

It seems to me that anyone who had problems didn't follow the instructions. They just thought they could download/install the driver and that would be it. But it actually requires a small amount of reading, not much. Plus, these are proprietary drivers. But my arm could be twisted, I have just been busy working on other stuff. Now if someone actually wrapped it in the HTML so all I would have to do is drop it in the directory and it looked like the rest of the pages (but give yourself credit) then it might just find it's way in there pronto. I should actually write a little database and get rid of the HTML..

TheQuirk
programmer
programmer
Posts: 113
Joined: Wed Jan 22, 2003 4:11 pm

Post by TheQuirk » Wed Feb 12, 2003 4:01 pm

never mentioned that, thanks for clearing that up!

/me tries to think of something new to do...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5712
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Feb 12, 2003 5:00 pm

I didn't mention it here, but I did at the "other" place before I left.

Post Reply