Re: [exim] Re: (no subject)

Etusivu
Poista viesti
Vastaa
Lähettäjä: Kjetil Torgrim Homme
Päiväys:  
Vastaanottaja: cjackson
Kopio: exim-users
Aihe: Re: [exim] Re: (no subject)
On tir, 2004-08-31 at 15:28 -0500, cjackson wrote:
> cjackson writes: 
> > condition = \
> >       ${if and \
> >         { \
> >             { eq \
> >                { \
> >                  ${lookup ldap {user="cn=admin,dc=dom,dc=com" pass=p \
> >                  ldap:///cn=${quote_ldap:$local_part},\
> >                  ou=${quote_ldap:$domain},\
> >                  dc=dom,dc=com?forwardOnly?}}{false} \
> >                }
> >             } \
> >             { or \
> >                  { \
> >                     { eq {$h_X-DSPAM-Result:}{Spam} } \
> >                     { def:h_X-Spam-Score:} \
> >                  } \
> >             } \
> >         } \
> >         {yes}{no} \
> >        }  

>
> Thanks, I fixed it. Those curly braces drive me batty.


I prefer to indent in a slightly more "LISP-like" manner:

condition = \
  ${if and {{eq {${lookup ldap {user="cn=admin,dc=dom,dc=com" \
                                pass=p \
                                ldap:///cn=${quote_ldap:$local_part},\
                                ou=${quote_ldap:$domain},\
                                dc=dom,dc=com?forwardOnly?}}\
                 {false}}} \
            {or {{eq {$h_X-DSPAM-Result:}\
                     {Spam}}\
                 {def:h_X-Spam-Score:}}}}\
       {yes}{no}}  


("oops, why aren't the two arguments to eq indented to the same level?"
or "why does the second } after "false" mark the end of the
{${lookup}?")

hope this helps -- next time :-)
--
Kjetil T.