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 :

root: mygmail@gmail.com

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


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" mygmail@gmail.com

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/sendmail.cf

  • +1 Good point. Not every system will send mail to an external destination without some configuration. – John Gardeniers Feb 11 '12 at 0:04
  • 1
    For Postfix, that should be /etc/postfix/main.cf and not something like /etc/mail/sendmail.cf. – 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.


This will work, but you may have to set parameter append_at_myorigin=no in main.cf 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.