| [...] I did my research on this and found out that I need a dnslookup
| router with mx_domains directive (rather than manualroute) to be able
| to make decision based on the MX of the recipients' domain.
|
| Now I came to a problem where I cannot use mx_domains inside
| manualroute, nor use route_list inside dnslookup. How do I get around
| this problem? Is there a clever trick to be able to achieve what I
| need? I was thinking the solution shall remain to be a manualroute
| router with additional condition to do a lookup on the recipients'
| domains MX records. Can a perl script be implemented to achieve this?
You can do what you want with a special version of the SMTP transport
that uses the 'hosts' and 'hosts_override' SMTP transport settings:
remote_smtp_esp:
debug_print = "T: remote_smtp_esp for $local_part@$domain"
driver = smtp
hosts = ESP_HOST
hosts_override = true
In your special mx_domains-based dnslookup router, just set this
transport instead of your regular SMTP transport.
(We use a version of this here to do special routing for some outgoing
messages.)
- cks