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

Currently my server acts as a gateway, checks AD for valid email addresses, if the email address exists in exchange it sends over the email, otherwise just rejects (typical)

I need Postfix to send any emails with specific domains to other servers (not same network).

Steps would go something like this:

get requested email
check if email exists in AD
if it doesn't exist, check if the domain is in a file and send that email to a server specified in that file

Is this even possible? I looked at smtp_fallback_relay but the second email is checked, it get rejected if not found in AD

share|improve this question
add comment

1 Answer

Postfix will verify validity before any routing is performed, so that order must be respected.

Put your valid recipient lists for exchange and the other destinations in one of the appropriate maps, and then put both in sequential transport_maps; you can make it not change the routing by just specifying joe@foo.bar smtp: as the RHS.

share|improve this answer
    
Let's say I have something like this: relay_recipient_maps = ldap:/etc/postfix/ldapusers.cf, hash:/etc/postfix/secondary /etc/postfix/secondary would have something like: @hello.com OK How can i have two transport maps for the same domain, and only use a particular transport map depending on if the email address is located in exchange? If an address well@hello.com is in exchange, use trasport_map1, but if it doesn't, use transport_map2. –  luthan Jan 31 '13 at 16:38
    
In the way I indicated above: place one after the other. –  adaptr Jan 31 '13 at 16:43
    
but i would have to have hello.com domain listed in both transport tables, just with different destinations. wouldn't the first transport table be used at all times? assume that i do not know the exact email addresses hosted at the remote server. –  luthan Jan 31 '13 at 17:12
    
i noticed that if i specify the exact email address in the second transport map, the setup works. however, if i set it up as catchall (@hello.com smtp:server.com), that gets ignored and the first transport table is used. –  luthan Jan 31 '13 at 17:29
    
Don't use catchalls. –  adaptr Jan 31 '13 at 18:11
show 1 more comment

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.