Mailing List Archive

Please help me with a Exim router condition
Hi everyone,

I wish to use a "condition =" for my router section which should evaluate to true if either of $sender_address_domain or $original_domain exist in the file /etc/mydomains.

Tried a lot of permutations & combinations using "if", "forany", "lookup" etc. but just can't figure it out. Any help is appreciated.

Regards,
Sam

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Please help me with a Exim router condition [ In reply to ]
On 14/07/2022 18:59, Sam via Exim-users wrote:
> I wish to use a "condition =" for my router section which should evaluate to true if either of $sender_address_domain or $original_domain exist in the file /etc/mydomains.

If the domains are one-per-line in that file:

${if or { \
{bool {${lookup {$sender_address_domain} lsearch (/etc/mydomains} {true} }} \
{bool {${lookup {$original_domain} lsearch (/etc/mydomains} {true} }} \
}}

--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/