2

I'm using Postfix 2.6.6 and accepting all mail to the server to go into one mailbox, like so:

main.cf:

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

virtual:

/@/ feedbacks

virtual_domains:

/.*/ 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?

1 Answer 1

1

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
/@example.com/  [email protected]
/@/ feedbacks

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

6
  • 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. Jan 20, 2012 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 mydomain.com as whatever internal machine the mail to mydomain.com should go to, and then add mydomain.com to the relay_domains parameter.
    – malcolmpdx
    Jan 20, 2012 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. Feb 15, 2012 at 17:44
  • So, what's it's MX point to, this domain? I'd go check intodns.com if you want a good reporting tool.
    – malcolmpdx
    Feb 16, 2012 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. Feb 17, 2012 at 20:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .