Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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'm running a MediaWiki install under Ubuntu Server 10.10. I have configured it to use the standard php mail() function with my local mail delivery agent (postfix). The mail gets sent from the MediaWiki site, but the only problem is that whenever the address it's meant to be sent to is on the same domain as the server, those mails get delivered to local inboxes on the Ubuntu server.

So basically, the server is linuxbox.companydomain.com, and our e-mails are name@companydomain.com. Any mail sent to an address like that simply ends up in the user's local inbox, e.g. a message to anders@companydomain.com ends up in /home/anders/mbox, while a message to anders@gmail.com would end up in the correct gmail inbox.

How do I prevent this from happening?

share|improve this question
up vote 2 down vote accepted

Mails to name@companydomain.com end up in a local inbox because Postfix is configured to use local(8) delivery for the companydomain.com domain. Most likely this happens because companydomain.com is listed in the mydestination parameter, either explicitly or implicitly (because for example myhostname is companydomain.com and mydestination is at its default value which includes $myhostname).

So try setting mydestination=. If that doesn't help, edit your question and post output of the following commands to give more information on your setup:

  • postconf -n
  • postconf mydestination
  • postconf myhostname
share|improve this answer

What you need is probably what is called a "smarthost" setup. Basically, you set up Postfix to pass everything on to a different SMTP server.

This is controlled by the relayhost configuration parameter in Postfix's main.cf.

You may also need to adjust other settings, particularly mydestination, for this to work.

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.