Redirecting root’s Email on Red Hat

red-hat-logo-bigIf you are a conscientious system administrator, you like to keep tabs on your server by checking root’s email at least once a day, correct?  If you manage more than one server, or get tired of having to log in to check your mail, you can redirect where email for the root user gets sent.

I ran into problems on Red Hat Enterprise 5.2 doing this, so I thought I’d post the resolution here.

When I changed “who receives root’s mail” in the /etc/aliases file to an address on another server, I stopped getting any email at all, and the system didn’t know where to store the bounced messages, so they were going to /var/spool/clientmqueue/

I was unable to send mail from the command line using sendmail, so I knew something was amiss.  /var/log/maillog was full of errors suchs as “DSN: Service unavailable” and “stat=’Service unavailable'”.

If you have similar issues, here is how tofix them:

First, make sure your system’s hostname is in /etc/mail/local-host-names/

Next, in your /etc/hosts.allow file, add this:

ALL: : allow

Next, add your email address to /etc/aliases under the “who receives root’s email” section.

Last, but not least, run:

That should take care of it!

About Will Chatham

Will Chatham is the Security Assessment Engineer for Arbor Networks. Since Netscape 2.0, he has worked in a wide array of environments including non-profit, corporate, small business, and government. He started as a web developer, moved into Linux system administration, and ultimately found his place as a security professional. Having most recently conquered the OSCP certification, Will continues to hack his way into various things in an effort to make them more secure.
Bookmark the permalink.

One Comment

  1. Hi there,

    Highly appreciated thsi post. Although, I am not using this feature but I am sure it will help a lot, specially if implementing in production environment.

    Good work !!!

Leave a Reply