Re: [Exim] curly bracket mess

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Nico Erfurth
Date:  
À: cjackson
CC: exim-users
Sujet: Re: [Exim] curly bracket mess
cjackson wrote:

> Please help me determine where this condition is screwy. The error is:
> missing } at end of string - could be header name not terminated by colon
>
> BTW, Line 6 tests for bounces. Is {} the right syntax?
>
> 1 hide condition = ${if and { \
> 2        { eq {${lookup ldap {user="cn=admin,dc=localsurface,dc=com" \
> 3        pass=PASS
> ldap:///cn=${quote_ldap:$local_part},ou=${quote_ldap:$domain}, \
> 4        dc=localsurface,dc=com?outOfOffice?sub?}}}{true}} \
> 5        { eq {$h_to}{$local_part@$domain}} \
> 6        { ! eq {$sender_address}{}} \
> 7        { ! eq {$h_from}{$local_part@$domain}} \
> 8        { ! match{$h_from}{\server@\}} \

                               ^Hu?    ^Hu?

> 9        { ! match{$h_from}{\daemon@\}} \
> 10      { ! match{$h_from}{\root@\}} \
> 11      { ! match{$h_subject}{\circular\}} \
> 12      { ! match{$h_subject}{\bulk\}} \
> 13      { ! match{$h_subject}{\list\}} \
> 14      { ! match{$h_subject}{\junk\}} \
> 15      { ! match{$h_subject}{\SPAM\}} \
> 16      { ! match{$h_subject}{\ADV\}} \
> 17      }{yes}{no}}


Here's a smaller and IMHO more readable version, why did you use the \
everywhere? (and as Tamas pointed out, you missed the colons)

Also making the ldap-lookup as last check, will short-circuit it, when
one of the other matches, so you do the "expensive" lookup only when
really needed.

hide condition = ${if and { \
   { eq {$h_to}{$local_part@$domain}} \
   { ! eq {$sender_address}{}} \
   { ! eq {$h_from:}{$local_part@$domain}} \
   { ! match{$h_from:}{^(server|(?:mailer)daemon|root)@}} \
   { ! match{$h_subject:}{(circular|bulk|list|junk|SPAM|ADV)}} \
   { eq {${lookup ldap {user="cn=admin,dc=localsurface,dc=com" \
       pass=PASS \
       ldap:///cn=${quote_ldap:$local_part},ou=${quote_ldap:$domain}, \
       dc=localsurface,dc=com?outOfOffice?sub?}}}{true}} \
}{yes}{no}}