Re: [exim] host lookup in ACLs

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Daniel Tiefnig
CC: exim-users
Assumpte: Re: [exim] host lookup in ACLs
On Mon, 11 Dec 2006, Daniel Tiefnig wrote:

> warn condition  = ${lookup{$sender_host_address} \
>                    dbm{/etc/exim/spamblock.dbm}{yes}fail}
>      message    = X-Inode-RBL: $sender_host_address is blacklisted
>      set acl_m2 = $sender_host_address is blacklisted

>
> So, if the IP Address is not found in the list, the string expansion is
> forced to fail, and should IMHO abort processing of the current "warn"
> acl verb. But that's not the case. Debug oputput tells me:


This is the second time today I have answered this question. It is all
documented:

condition = <string>

    This feature allows you to make up custom conditions. If the result of
    expanding the string is an empty string, the number zero, or one of the
    strings "no" or "false", the condition is false. If the result is any
    non-zero number, or one of the strings "yes" or "true", the condition is
    true. For any other value, some error is assumed to have occurred, and the
    ACL returns "defer". However, if the expansion is forced to fail, the
    condition is ignored. The effect is to treat it as true, whether it is
    positive or negative.


It seemed useful to make "{no}" and "fail" behave differently so that
you can choose which you want.

-- 
Philip Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book