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

I'm using postfix server with webmin, which means my web server is on the same machine.

My mail setup is as follows: I have an external e-mail solution (paid for per mailbox) which I use and thus the MX records etc are setup correctly to go there.

However I also have setup a local mailbox for the domain in question so that I can send e-mails from the local webserver securely and automatically via a web app. This is reflected in the SPF records.

The problem now is when I send e-mails using the local server to my own domain. Postfix tries to look locally first because I have setup a local mailbox. But I don't want that to happen as the real mailboxes are in the external server.

Where do I have to look and what do I have to do in order to setup postfix using webmin so that it will either:

  1. don't look locally for certain domains even if there is a mailbox locally

  2. don't look locally whatever the domain even if there is a mailbox locally.

share|improve this question
It will be helpful to post your current config. – Khaled Jan 17 '12 at 4:17
I strongly agree with Khaled. Please give us the results to the command sudo postconf -n to show us the non-default configuration settings. – invalidsyntax Jan 17 '12 at 6:34
Your configuration is screwed up. This must be corrected. – mailq Jan 17 '12 at 21:59
This question contains a solution that may apply to your problem:… – Tristan CHARBONNIER Mar 23 '15 at 17:18

It's hard to tell exactly what the issue is without seeing your current configuration (please post us results from sudo postconf -n), but I just went through an issue just like what you explain, except minus webmin.

Out of the possibilities I am aware of, one or more of the following could apply:

  • you have a virtual alias setup in /etc/postfix/virtual that is causing mail redirection (to a local relay perhaps). If you change virtual, make sure to call sudo postmap /etc/postfix/virtual to map your changes into postfix.
  • mydestination variable in /etc/postfix/ includes your server hostname. This was the issue I had, actually. By removing this (I left it equal to mydestination = localhost.localdomain, localhost) I was able to regain my sanity. Note that after making any changes to, you must call postfix reload to reload your changes into postfix.

For reference:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.