On 2021-08-26, Cyborg via Exim-users <exim-users@???> wrote:
> Hi,
>
> the exim docs do not seem to cover the topic of "how to build" a
> local_domains list, they only cover the topic of "whats the syntax of a
> list".
>
> My actual problem is to build the content of local_domains from DNS IN
> MX Records. The server shall only handle the domain as local,
> if the mx is pointing to an address on the host.
Ok, if DNS has the answer, what do you need local_domains for?
> Has anyone done this?
No, because it's impossible, there is no DNS lookup that will find all
the domains that use any host as their MX.
> Can it be archived without perl script execution, which would be a
> performance drop at least?
There's probably a better solution to be had by using routers.
something like:
routers
i_the_mx:
driver = dnslookup
ignore_target_hosts = !<this_host_ip_address> : !<this_host_other_ip_address> : ...
self = send
# code here to check the mailbox part.
deny_external:
driver = manualroute
condition=${if eq{}{$authenticated_id}}
allow_fail
data=:fail: relay access denied
...
Then in the rcpt acl you just say
require
verify=recipient
--
Jasen.