Exim ACL to limit sender to send mail only to localdomain

access-control-listemailexim

I'm currently using exim, and i need to limit a mail address to send mails only to local domain and deny mail to outgoing domains.

I think it could be like this :

deny  local_parts   = sender@localdomain
      domains       = !+local_domains

Can you please help me on that way ?

Thanks you very much guys 🙂

Best Answer

Add the next rule at the beginning of acl_rcpt (or how you have called it)

deny condition = ${lookup{$sender_address}nwildlsearch{/path/to/the/local.user.list}{yes}}
       domains = !+local_domains

File /path/to/the/local.user.list should contain regexps one per line:

^john@domain\.tld
^.*_dpt@domain\.tld
^.*@inner\.domain\.tld