Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 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/  someother@place.com
/@/ 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 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 '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 intodns.com 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

 
discard

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.