Re: [Exim] Conditon Problem

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Nico Erfurth
Dátum:  
Címzett: Kai Riasol Gonzalez
CC: exim-users
Tárgy: Re: [Exim] Conditon Problem
Kai Riasol Gonzalez wrote:

> vacation:
>   driver = accept
>   unseen = true
>   expn = false
>   verify = false
>   condition =  ${if eq \
>                         {lookup ldap \
>                                 { \
>                                   user=LDAPUSER pass=LDAPPASS \

>
> ldap://LDAPSERVER/ou=user,dc=domain,dc=net?vacationStatus?sub?(&(mail=$local_part@$domain)(accountStatus=enable))
>  \
>                                 } \
>                                 {$value} \
>                         } \
>                         {enable} {yes}{no} \
>                 }
>   transport = vacation_user
>   errors_to = postmaster@${domain}

>
> in the logfile i get this.
>
> failed to expand condition "${if eq {lookup ldap { user="xxxx" pass=xxxxx
> ldap://localhost:38
> 9/ou=user,dc=domain,dc=net?vacationStatus?sub?(&(mail=$local_part@$domain)(accountStatus=enable))
> } {$value} } {enable} {yes}{no} }" for vacation router: mis
> sing or misplaced { or }



You missed the ${} around your lookup. But anyway, this can be done a
lot simpler.

condition = ${lookup ldap {user=LDAPUSER pass=LDAPPASS \
     ldap://LDAPSERVER/ou=user,dc=domain,dc=net?vacationStatus?sub?\
     (&(mail=${quote_ldap:$local_part}\@$domain)(accountStatus=enable))}\
   {yes}{no}}


Because you're using an ldap-filter on the acountStatus-attribute it
should be enough to check for "Did the lookup return anything?". In this
case the lookup returns yes, otherwise no.

Nico