[exim] Struggling with condition= syntax

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Chris Shucksmith
Dátum:  
Címzett: Exim users list
Tárgy: [exim] Struggling with condition= syntax
Hi,

I am trying to interpret several header values in the condition= line of
a router. I'm having real problems with curly braces and subsequently
Exim fails to start. If anyone can spot the error I would appreciate
your guidance.

I'm up against:

merlot exim # /etc/init.d/exim restart
* Starting exim ...
2006-04-25 10:34:03 Exim configuration error in line 263 of
/etc/exim/exim.conf:
  option setting expected: {def:header_X-Spam-Flag:}
{def:header_X-Amavis-Alert:}  { and { {def:header_X-Merlot-Blacklisted:
} {def:header_X-Spam-Level: } {>{$header_X-Spam-Level}{1.5}} }} }
{1}{0}}                                                            [ !!]



*ACL*
warn    message = X-Merlot-Blacklisted: By $dnslist_domain - $dnslist_text
        !hosts = +relay_from_hosts
        !authenticated = *
        dnslists = dnsbl.njabl.org : bl.spamcop.net : sbl.spamhaus.org :
list.dsbl.org : cbl.abuseat.org : relays.ordb.org : dnsbl.sorbs.net



Before the execution of the following router the following headers exist:
X-Spam-Status: No, score=3.301 required=3.31 tests=[blah]
X-Spam-Score: 3.301
X-Spam-Level: ***

And possibly one or both of
X-Merlot-Blacklisted: By bl.spamcop.net
X-Spam-Flag: YES

*ROUTER*

# Junk if
#   defined(header_X-Spam-Flag:)            - amavis scores above trash
threshold
#   OR defined(header_X-Amavis-Alert:)      - also catch blocked files
#   OR { Blacklisted AND Stars >= ** }      - spam blacklisted senders
UNLESS the email looks particularly legitimate


spam:
  driver = accept
  domains = ${lookup mysql {MYSQL_Q_LOCAL}{$value}}
  condition = ${if or {
                        {def:header_X-Spam-Flag:}\
                        {def:header_X-Amavis-Alert:}\
                        { and { \
                               {def:header_X-Merlot-Blacklisted: } \
                               {def:header_X-Spam-Level: } \
   # hopefully this will prevent expansion of the third argument... is
AND lazy?
                               {>{$header_X-Spam-Level}{1.5}} \
                        }} \
                      }{1}{0}}
  transport = vmailspam



The "vmailspam" transport simply drops the message into the SPAM sub
directory of the users mailbox.

Thanks :)

Chris Shucksmith



--
=========================================
Christopher Shucksmith
[w] www.shucksmith.com [m]07905016603
christopher.shucksmith@???
=========================================