Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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, and our e-mails are Any mail sent to an address like that simply ends up in the user's local inbox, e.g. a message to ends up in /home/anders/mbox, while a message to would end up in the correct gmail inbox.

How do I prevent this from happening?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Mails to end up in a local inbox because Postfix is configured to use local(8) delivery for the domain. Most likely this happens because is listed in the mydestination parameter, either explicitly or implicitly (because for example myhostname is 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

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.