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.

I'm looking at have exim redirect a subset of mail to one of our smarthosts based on the looked up mx record. Currently I can do this by specifying all of the domains and using a manualroute router, but I'd like it to be automatic going forward.

Example:

DNS => Domain1.com in mx 10 subhost.outdomain.com

Exim would then need to have a condition in the manualrouter based on that mxdomain.

Anyone know how to do this without an external script? Exim already knows the mx_domain while processing so it should be about to do it.

share|improve this question
add comment

2 Answers

As far as I'm aware, exim only becomes aware of the MX record in a destination domain when it attempts SMTP delivery via the SMTP transport. What you need to route the mail to a different transport depending on the value of the MX record.

I don't believe there's any way to get a router to know the MX record of the destination domain without using an external script. I'm prepared for someone to come along and tell me I'm wrong though...

share|improve this answer
add comment

The route_data variable is expanded, so you can use

route_data = ${lookup dnsdb{>: mxh=Domain1.com}{$value}fail}

It doesn't respect MX priotities, as I haven't found out how to sort in string expansions.

share|improve this answer
add 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.