Re: [exim] Problem routing dependent upon a whitelist

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Philip Hazel
Ημερομηνία:  
Προς: Steve Cox
Υ/ο: exim-users
Αντικείμενο: Re: [exim] Problem routing dependent upon a whitelist
On Wed, 22 Mar 2006, Steve Cox wrote:

> nonwhitelist:
> debug_print = "R: not white-listed for sender or recipient"
> driver = accept
> senders = ! lsearch;/etc/exim4/local_MM_whitelist
> condition = ! ${if eq {$local_part@$domain}{lsearch;/etc/exim4/local_MM_whitelist}{1}{0}}
> transport = dump_mail
> no_more
>
> If the sender is on the whitelist, it works fine - but the condition
> to pick up the recipient - 'condition = ...' - always causes the
> email to be matched and dumped. (the whitelist is in
> ;/etc/exim4/local_MM_whitelist).


You have the syntax wrong. The result of expanding "condition" is never
going to be 1 or 0 because it will always start with "! ". This is
treated as "true"; see the description of "condition" in chapter 15 of
the manual. Then you are trying to compare an address to a literal
string, and that will always be false.

Did you try using a -d debug run to see what was going on?

You probably want something like

  condition = ${lookup{$local_part@domain}lsearch\
    {/etc/exim4/local_MM_whitelist}{1}{0}}



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