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 2.6.6 and accepting all mail to the server to go into one mailbox, like so:

mydestination = regexp:/etc/postfix/virtual_domains
virtual_alias_maps = regexp:/etc/postfix/virtual


/@/ feedbacks


/.*/ MATCH

This works great, except it doesn't let mail go external, since it thinks it's all local. I'd like to get one domain, say, MYDOMAIN.COM, to be handled externally. What do I need to do differently?

EDIT: I want to elaborate on this question a bit. The server is set to handle mail for any incoming domains, through the setup I have listed above. However, as a result, it will not send any OUTGOING mail properly, since it thinks every domain is local to itself. How can I exclude a domain from the match and let it be handled normally?

share|improve this question

When you say "go external" I assume you mean "go to a different mail server for final delivery", but still be handled by this host in some way.

If that's the case, I believe all you would need to do is modify the virtual_alias_maps file above to read something like:

#/etc/postfix/virtual file
/@/ feedbacks

since it's a regexp map, and thus, first match in the file wins.

share|improve this answer
No, MYDOMAIN.COM is hosted externally from the server, and I need mail to MYDOMAIN.COM to go external to whatever its standard MX is. – Mike Jan 20 '12 at 19:51
Then this is something to fix with DNS, I would think. If the MX is set correctly so that wherever you're sending mail from looks up the correct MX, mail will go there, and not to this server. If you're using this server as some sort of mail gateway, then you will need to configure this machine to be able to resolve the MX record for as whatever internal machine the mail to should go to, and then add to the relay_domains parameter. – malcolmpdx Jan 20 '12 at 20:49
That's what I'm trying to figure out, actually. Right now with its setup, it thinks ALL domains are local to itself. – Mike Feb 15 '12 at 17:44
So, what's it's MX point to, this domain? I'd go check if you want a good reporting tool. – malcolmpdx Feb 16 '12 at 4:12
The issue is that it's not looking up the MX. Due to the virtual domain match I've set up, it thinks every domain is local to itself, so it doesn't try to send externally. – Mike Feb 17 '12 at 20:24

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.