Exim outgoing email by remote mail server, but not sended by php mail()

I use this "section: PREROUTERS" to send all emails from a domain to SMARTHHOST.


Section: PREROUTERS:
Code:
send_via_sophos:
driver = manualroute
domains = ! +local_domains
senders = *@sender.domain.com
transport = sophos_smtp
route_list = "* ip2.domain.com::587 byname"
host_find_failed = defer
no_more


Section: TRANSPORTSTART:
Code:
sophos_smtp:
driver = smtp
helo_data = sender.domain.com
hosts = ip2.domain.com
hosts_require_auth = mail.domain.com
dkim_domain = ip2.domain.com
dkim_selector = default
dkim_private_key = /home/user/dkim.private.key
#dkim_canon = relaxed

With this, all email accounts from *@sender.domain.com will be forwarded to smarthhost.
 
I use this "section: PREROUTERS" to send all emails from a domain to SMARTHHOST.


Section: PREROUTERS:
Code:
send_via_sophos:
driver = manualroute
domains = ! +local_domains
senders = *@sender.domain.com
transport = sophos_smtp
route_list = "* ip2.domain.com::587 byname"
host_find_failed = defer
no_more


Section: TRANSPORTSTART:
Code:
sophos_smtp:
driver = smtp
helo_data = sender.domain.com
hosts = ip2.domain.com
hosts_require_auth = mail.domain.com
dkim_domain = ip2.domain.com
dkim_selector = default
dkim_private_key = /home/user/dkim.private.key
#dkim_canon = relaxed

With this, all email accounts from *@sender.domain.com will be forwarded to smarthhost.
ok, it's good lead. but i have 200 domains..
 
Oh... ?
This users who use phpmail, have many domains?
yes, but sometimes they use php-mail-class where sending address is address of user - who fills out the form. so if sender use domain from user, i want to redirect smtp to mandrill, all other email i want to send normally
 
Other idea for multiple domains, add more condition to smart_route

this is just example. syntax might not working.
Code:
smart_route:
    driver = manualroute
    domains = ! +local_domains
    ignore_target_hosts = 127.0.0.0/8

    condition = "${perl{check_limits}}"
    condition = ${lookup {$sender_address_domain}lsearch{/etc/whilelist_external_relay} {yes}{no}}

    transport = remote_smtp

    route_list = * smtp.example.com
    no_more

then put any domains you want in "/etc/whilelist_external_relay".
 
Back
Top