[exim] Confused about lookups and ldap_default_servers

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Robert Bannocks
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: [exim] Confused about lookups and ldap_default_servers
I want to set ldap_default_servers to get its data from the dns and have
developed a look up as follows:

ldap_default_servers = ${extract{4}{\ }{${extract{1}{!}{${lookup
dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$value}fail}}}}}

(actually is is mopre complex but that should suffice for an example of
the problem)

When I test this with exim -be this works:

# exim -be
> ${extract{4}{\ }{${extract{1}{!}{${lookup

dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$value}fail}}}}}
somehost.nhm.ac.uk

However when I rely on this in the configuration file it fails.
It seems that the string that is ldap_default_servers does not get
interpreted

Is this correct behaviour? Is my syntax wrong? At what time is this
parameter interpreted, it at start time or at router run time?

Any help appreciated.

Extract from exim -bv -d+all for the appropriate router:

15:29:53 16404 expanding:  user=LOOKUPACCOUNT pass=PASSWORD
ldap:///DC=nhm,DC=ac,DC=uk??sub?(&(mailNickname=${quote_ldap:$local_part
})(&(objectclass=person)(msExc
hUserAccountControl=0)))
15:29:53 16404    result:  user=LOOKUPACCOUNT pass=PASSWORD
ldap:///DC=nhm,DC=ac,DC=uk??sub?(&(mailNickname=robt4)(&(objectclass=per
son)(msExchUserAccountControl=
0)))
15:29:53 16404 search_open: ldapdn "NULL"
15:29:53 16404 search_find: file="NULL"
15:29:53 16404   key="user=LOOKUPACCOUNT pass=PASSWORD
ldap:///DC=nhm,DC=ac,DC=uk??sub?(&(mailNickname=robt4)(&(objectclass=per
son)(msExchUserAccountControl=0)))"
 partial=-1 affix=NULL starflags=0
15:29:53 16404 LRU list:
15:29:53 16404   :/etc/aliases
15:29:53 16404   End
15:29:53 16404 internal_search_find: file="NULL"
15:29:53 16404   type=ldapdn key="user=LOOKUPACCOUNT pass=PASSWORD
ldap:///DC=nhm,DC=ac,DC=uk??sub?(&(mailNickname=robt4)(&(objectclass=per
son)(msExchUserAccountC
ontrol=0)))"
15:29:53 16404 database lookup required for user=LOOKUPACCOUNT
pass=PASSWORD
ldap:///DC=nhm,DC=ac,DC=uk??sub?(&(mailNickname=robt4)(&(objectclass=per
son)(msExchUs
erAccountControl=0)))
15:29:53 16404 LDAP parameters: user=LOOKUPACCOUNT pass=PASSWORD size=0
time=0 connect=0 dereference=0 referrals=on
15:29:53 16404 perform_ldap_search: ldapdn URL =
"ldap:///DC=nhm,DC=ac,DC=uk??sub?(&(mailNickname=robt4)(&(objectclass=pe
rson)(msExchUserAccountControl=0)))"
 server=${extract{4}{\ }{${extract{1}{!}{${lookup
dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$value}fail}}}}} port=0 sizelimit=0
timelimit=0 tcplimit=0
15:29:53 16404 after ldap_url_parse: host=${extract{4}{\
}{${extract{1}{!}{${lookup
dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$value}fail}}}}} port=0
15:29:53 16404 initialized for LDAP (v3) server ${extract{4}{\
}{${extract{1}{!}{${lookup
dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$value}fail}}}}}:389
15:29:53 16404 binding with user=LOOKUPACCOUNT password=PASSWORD
15:29:53 16404 failed to bind the LDAP connection to server
${extract{4}{\ }{${extract{1}{!}{${lookup
dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$value}fail}}}}}:389 -
ldap_bind() returned -1
15:29:53 16404 lookup deferred: failed to bind the LDAP connection to
server ${extract{4}{\ }{${extract{1}{!}{${lookup
dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$value
}fail}}}}}:389 - ldap_bind() returned -1
15:29:53 16404 failed to expand: ${lookup ldapdn { user=LOOKUPACCOUNT
pass=PASSWORD
ldap:///DC=nhm,DC=ac,DC=uk??sub?(&(mailNickname=${quote_ldap:$local_part
})(&(o
bjectclass=person)(msExchUserAccountControl=0)))}}
15:29:53 16404    error message: lookup of "user=LOOKUPACCOUNT
pass=PASSWORD
ldap:///DC=nhm,DC=ac,DC=uk??sub?(&(mailNickname=robt4)(&(objectclass=per
son)(msExchUs
erAccountControl=0)))" gave DEFER: failed to bind the LDAP connection to
server ${extract{4}{\ }{${extract{1}{!}{${lookup
dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$va
lue}fail}}}}}:389 - ldap_bind() returned -1
15:29:53 16404 condition check lookup defer
15:29:53 16404 search_tidyup called
15:29:53 16404 unbind LDAP connection to ${extract{4}{\
}{${extract{1}{!}{${lookup
dnsdb{>!srv=_gc._tcp.nhm.ac.uk}{$value}fail}}}}}:389
15:29:53 16404 >>>>>>>>>>>>>>>> Exim pid=16404 terminating with rc=1

>>>>>>>>>>>>>>>>