Partial Local Delivery

tincboy

Verified User
Joined
Aug 14, 2009
Messages
126
I'm using DirectAdmin as email server in a scenario that main email server is an other server but for new accounts I should use a separate server, therefor from main server I'm forwarding incoming emails to second server which is DirectAdmin,
Right now using a middle domain and forwarders I can receive incoming emails on second server without problem, but the issue is when I want to send an email from accounts on second server to accounts on first server the local delivery option which is necessary for forwarders to work, is making troubles and causing emails to be rejected because those accounts are not available on first server.
Any info on how to change exim.pl or any other piece of configs to handle this kind of delivery?
 
Try removing the domain from the second server's /etc/virtual/domains file ?
 
This way the forwarder will not deliver emails to second server.
Editing the second server's local domains file shouldn't affect how the first server routes email. It should only affect how the second server routes email.
 
Editing the second server's local domains file shouldn't affect how the first server routes email. It should only affect how the second server routes email.
The second server is using forwarder to deliver emails from middle domain to actual domain, that's necessary to have local delivery on second server.
 
I did it with smart route.
Code:
cat /etc/exim.routers.pre.conf
smart_route:
     driver = manualroute
     ignore_target_hosts = 127.0.0.0/8
     transport = remote_smtp
     condition=  ${if eq{${lookup{$local_part}lsearch{/etc/virtual/domain.com/passwd}{$value}}}{}{true}{false}}
     route_data = ${if eq{${lookup{$local_part}lsearch{/etc/virtual/domain.com/passwd}{$value}}}{}{"remote.smtp.tld"}{"not important"}}
     no_more
I used a remote smtp to ensure for not local users email is going to be delivered out of the local Exim server.
 
I did it with smart route.
Code:
cat /etc/exim.routers.pre.conf
smart_route:
     driver = manualroute
     ignore_target_hosts = 127.0.0.0/8
     transport = remote_smtp
     condition=  ${if eq{${lookup{$local_part}lsearch{/etc/virtual/domain.com/passwd}{$value}}}{}{true}{false}}
     route_data = ${if eq{${lookup{$local_part}lsearch{/etc/virtual/domain.com/passwd}{$value}}}{}{"remote.smtp.tld"}{"not important"}}
     no_more
I used a remote smtp to ensure for not local users email is going to be delivered out of the local Exim server.
Very nicely done. I was looking at the smart route option for this but hadn’t had enough time to write/test it. Thank you for sharing your solution!
 
Back
Top