Re: [exim] Help to logical OR two conditions

Góra strony
Delete this message
Reply to this message
Autor: Victor Sudakov
Data:  
Dla: exim-users
Temat: Re: [exim] Help to logical OR two conditions
Cyborg via Exim-users wrote:
> Am 01.10.20 um 08:24 schrieb Victor Sudakov via Exim-users:
> > Dear Colleagues,
> >
> > Could you please help me unite the following two ACL expressions into one:
> >
> > accept condition      = ${lookup{$local_part@$domain}lsearch{/etc/dovecot/aliases}{yes}}
> > accept condition      = ${lookup{$local_part@$domain}lsearch{/etc/dovecot/users}{yes}}

> >
> > Should be fairly simple but... I've tried variants of '${if or {...' by
> > the manual but all I got were errors like
> >
> > "${or" is not a known operator (or a } is missing in a variable reference)
> >
> > I'm probably miscounting brackets or something. Could you please suggest
> > a working tested example of a logical OR between such conditions?
> >
>
> accept  condition  = ${if or{\
>                                { and{ {CONDITION 1}{CONDITION 2} }}\
>                                { CONDITION 3 }\
>                               } {1}}


So, for my case it should look like this, right )(copied verbatim from my test config):

  accept condition =  ${if or{\
                      ${lookup{$local_part@$domain}lsearch{/etc/dovecot/aliases}{yes}} \
                      ${lookup{$local_part@$domain}lsearch{/etc/dovecot/users}{yes}} \
                      } {yes}}



Does not work however:
failed to expand ACL string "${if or{${lookup{$local_part@$domain}lsearch{/etc/dovecot/aliases}{yes}} ${lookup{$local_part@$domain}lsearch{/etc/dovecot/users}{yes}} } {yes}}": each subcondition inside an "or{...}" condition must be in its own {}


What am I doing wrong?

>
> best regards,
> Marius
>
> --
> ## 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/


--
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/