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?

2 Answers 2


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

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.

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.