Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

Is it possible to set the root mail address to my gmail address? And if so how?

Would it work by just setting my email address in the following file?

/etc/aliases :


Or does it need to be a domain that is hosted on my webserver?

As a side note: not really sure this has to do with postfix I'm just starting to use freebsd as webserver trying to setup a mailserver using this tutorial

share|improve this question
up vote 4 down vote accepted

Yes you can send email to an account outside your mailserver. But, it might not work out of the box.

Test it first from the commandline:

[root@host ~]# /usr/bin/mail -s "Test from $HOSTNAME"

If the mail does not arrive at your gmail account, then you should see a reason why in /var/log/maillog . The most common reason that I see is that the host does not know how to route mail to the outside world, or does not have a Smarthost configured in /etc/mail/

share|improve this answer
+1 Good point. Not every system will send mail to an external destination without some configuration. – John Gardeniers Feb 11 '12 at 0:04
For Postfix, that should be /etc/postfix/ and not something like /etc/mail/ – wzzrd Feb 11 '12 at 7:45
actually In this case I'm using postfix but testing It like this is very usefull. – FLY Feb 13 '12 at 14:31

This will work fine. I forward root mail to off site mail addresses all the time.

share|improve this answer

This will work, but you may have to set parameter append_at_myorigin=no in in case myorigin is set. Otherwise if you are sending locally to "root" postfix by default will append myorigin value to the domain part of the recipient.

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.