Server Fault is a question and answer site for system and network administrators. 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 would like to forward mail that gets sent root@localhost on multiple servers to our company admin account (e-mail is hosted on gmail)

I have installed ssmtp on centos 5.5 via yum and configured it. i've also changed the last line in /etc/aliases to reflect where mail to root should go to.

I've then tried sending mail to root - this gets delivered without a problem (mail -v root) I've also tried sending mail to root@localhost - this is not delivered to the specified gmail account.

share|improve this question

Unfortunately, ssmtp does not read ~/.forward. Here is a quote from the ssmtp manpage.

It does not do aliasing, which must be done either in the user agent or on the mailhub. Nor does it honor .forwards, which have to be done on the recieving host. It especially does not deliver to pipelines.

share|improve this answer

This is a an old post. However, this may useful to some one else.

Based on this link

  • Ensure mailx is installed on your system ( try mailx -? )
  • Edit /etc/mail.rc like this:

    alias root root<>

Now, mails to root@localhost will be sent to You can add other addresses too, not just root.

share|improve this answer

Have you configured and enabled From rewriting? locahost is not a valid domain.

See this post.

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.