Re: [exim] Help to logical OR two conditions

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Cyborg
Data:  
Para: exim-users
Assunto: Re: [exim] Help to logical OR two conditions
Am 01.10.20 um 11:00 schrieb Victor Sudakov via Exim-users:
> Cyborg via Exim-users wrote:
>>>> 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?
>>>
>>>
>> I cant explain it better than the error message already does :
>>
>> each subcondition inside an "or{...}" condition must be in its own {}
>>
>>
>> means:
>>
>>   accept condition =  ${if or{\
>>                       *{*${lookup{$local_part@$domain}lsearch{/etc/dovecot/aliases}{yes}}*}* \
>>                       *{*${lookup{$local_part@$domain}lsearch{/etc/dovecot/users}{yes}}*}* \
>>                       } {yes}}
> This variant does not work either:

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

>
> 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}}": condition name expected, but found "${lookup{$local_" inside "or{...}" condition
>
> And I'm damned if I understand what is "condition name expected."
>
>
>


to make it bool:

{match{ ${lookup ..... }}{yes or what it shall match}}

full example to make it easier:

 accept  condition  = ${if or{\
                               { eq{$h_subject}{Hello} }\
                               { match{ ${lookup mysql {SELECT 1 FROM table WHERE a=b LIMIT 1 }} }*{1}* }\
                              } *{1}*}


I'm not using lsearches, so i can't give you an working example.. but i'm pretty sure one is in the docs.


best regards,
Marius