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.

link|improve this question
1  
It will be helpful to post your current config. – Khaled Jan 17 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 at 6:34
Your configuration is screwed up. This must be corrected. – mailq Jan 17 at 21:59
feedback

1 Answer

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/main.cf 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 main.cf, you must call postfix reload to reload your changes into postfix.

For reference: http://www.postfix.org/STANDARD_CONFIGURATION_README.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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