Hello All,
I am working to resolve the following issue for a while and I am really stuck.
The Case:
We use on several hosting servers DirectAdmin, and this has Exim default installed, all works great until I try to integrate our SpamExperts gateway's
I would like to deliver outgoing mail to a smart host based upon the senders domain and I would like to do a dynamic lookup in a text file for domains that are valid.
So if the domain name in a text file would match then it would use the appropriate smart host and if not it will go to a next or use the lookup host.
The problem i am facing is that I cannot get it to work with a file lookup (lsearch) but I can get it to work with a direct entry
Example1: (working)
This is working with a direct config on the senders line: "senders = ^.*@domain1<
mailto:%5e.*@domain1>.com : ^.*@domain2.com<
mailto:%5e.*@domain2.com>"
Only the listed domains on the line are now send to the smart host, and other domains not.
----
spamexperts_smarthost_router:
driver = manualroute
domains = ! +local_domains
#search in file
senders = ^.*@domain1<
mailto:%5e.*@domain1>.com : ^.*@domain2.com<
mailto:%5e.*@domain2.com>
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
transport = spamexperts_smarthost_transport
route_list = * my.smarthost.com::587
lookuphost:
driver = dnslookup
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
transport = remote_smtp
no_more
----
Example2: (not working)
Here I try to search a domain name in a file with "senders = ^.@lsearch;/etc/virtual/spamexperts_domainsout<
mailto:%5e.@lsearch;/etc/virtual/spamexperts_domainsout>"
It does not complain with errors, but it also does not match. I tried debugging options like : -d+all but I am not seeing the debugging on how it is selecting in the senders=
spamexperts_smarthost_router:
driver = manualroute
domains = ! +local_domains
#search in file
senders = ^.@lsearch;/etc/virtual/spamexperts_domainsout
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
transport = spamexperts_smarthost_transport
route_list = * my.smarthost.com::587
lookuphost:
driver = dnslookup
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
transport = remote_smtp
no_more
---
other thoughts:
I tried to use sender_domains as senders but it then says it does not exist (sender_domains )
Can anyone please assist? Is there perhaps a bug or why it is not searching the file correctly..
As I understand it should match the email address like name@???<
mailto:name@domain.com> but I want to list only domain.com in the textfile and then accept everything before the domainname so why is ^.@lsearch;/etc/virtual/spamexperts_domainsout<
mailto:%5e.@lsearch;/etc/virtual/spamexperts_domainsout> then not working?
And or do I need a total other approach to filter the senders domain to direct it to a custom smarthost
Thanks in advance
Jan Dijk