Re: [exim] Access $domain in ACL?

Top Page
Delete this message
Reply to this message
Author: Heiko Schlittermann
Date:  
To: exim-users
Subject: Re: [exim] Access $domain in ACL?
Heiko Schlittermann via Exim-users <exim-users@???> (Mo 16 Sep 2019 08:57:19 CEST):
>
> The data ACL runs *once* per message. The message can have multiple
> recipients, so which domain do you expect in $domain?


I should have read your mail properly. You want to know the list of
recipient domains in your DATA acl.

Try


        accept logwrite = ${reduce\
              {<,${map{<,$recipients}{${domain:$item}}}}\
              {}\
              {${if inlist{$item}{<,$value}\
                  {$value}\
                  {${if def:value {$value,$item}{$item}}}\
              }}}


Or more readable using macros

DOMAINS = ${map{<,$recipients}{${domain:$item}}}
APPEND_ITEM = ${if def:value {$value,$item}{$item}}
INLIST = inlist{$item}{<,$value}

  accept logwrite = ${reduce{<,DOMAINS}\
              {}\
              {${if INLIST{$value}{APPEND_ITEM}}}}



Maybe you'll find more simple way :)

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
--
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -