Hello Exim-users,
I need some help with LDAP and Exim4 mail delivery.And I realy can't
understand what missing.
Also I try google, and can't find many Exim4+LDAP docs.I found 2 pages
that help:
http://www.akbkhome.com/news/LDAP_IMAP.html and
http://www.exim.org/mailman/htdig/exim-users/Week-of-Mon-20030407/052188
.html
When I try to test delivery for some user (from LDAP) I get this error:
exim4 -bt test@???
test@??? is undeliverable: Unrouteable address
I test to query LDAP via PhpLDAPadmin with base="dc=test,dc=com"
filter="(&(uid=test))" and it return data.
It seems like Exim can't understand resulsts from LDAP.
LDIF for test@??? here:
version: 1
# LDIF Export for: uid=test,dc=test,dc=com
# Generated by phpLDAPadmin on November 28, 2003 5:02 pm
# Server: My LDAP Server (localhost)
# Search Scope: base
# Total entries: 1
# Entry 1: uid=test,dc=test,dc=com
dn: uid=test,dc=test,dc=com
givenName: test
mail: test
uid: test
sn: Knowles
cn: Alan Knowles
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
objectClass: posixAccount
objectClass: CourierMailAccount
uidNumber: 2000
gidNumber: 2000
homeDirectory: test
userPassword: {crypt}/COxQ7y/a3frs
LDAP Debug here:
debian:/etc/exim4# slapd -d 256
slap_open_listener: socket() failed for AF_INET6 errno=97 (Address
family not supported by protocol)
bdb_initialize: Sleepycat Software: Berkeley DB 4.1.25: (December 19,
2002)
bdb_db_init: Initializing BDB database
slapd starting
conn=0 fd=12 ACCEPT from IP=127.0.0.1:33730 (IP=0.0.0.0:389)
conn=0 op=0 BIND dn="cn=admin,dc=test,dc=com" method=128
conn=0 op=0 BIND dn="cn=admin,dc=test,dc=com" mech=simple ssf=0
conn=0 op=0 RESULT tag=97 err=0 text=
deferring operation
conn=0 op=1 SRCH base="dc=test,dc=com" scope=2 filter="(&(uid=test))"
conn=0 op=1 SRCH attr=mail
conn=0 op=2 UNBIND
conn=0 op=1 SEARCH RESULT tag=101 err=0 nentries=1 text=
conn=0 fd=12 closed
Using configs for Exim4 here:
Router config:
begin routers
ldap_user:
driver = redirect
allow_fail
allow_defer
data = ${lookup ldapm {user="cn=admin,dc=test,dc=com" pass=admin
ldap://localhost:389/dc=test,dc=com?mail?sub?(&(uid=${local_part}))}}
user = courier
file_transport = address_file
pipe_transport = address_pipe
Transport config:
local_delivery:
driver = appendfile
group = mail
maildir_format = true
directory = /var/mail/${local_part}/Maildir
create_directory = true
mode = 0660
mode_fail_narrower = false
envelope_to_add = true
return_path_add = true
Some Exim Debug:
debian:/etc/exim4# exim4 -d-all+lookup -M 1APkka-0007nB-Dl
Exim version 4.24 uid=0 gid=0 pid=29960 D=10000
Berkeley DB: Sleepycat Software: Berkeley DB 3.2.9: (June 16, 2003)
Support for: iconv() IPv6 PAM Perl GnuTLS
Authenticators: cram_md5 plaintext spa
Routers: accept dnslookup ipliteral iplookup manualroute queryprogram
redirect
Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp
Fixed never_users: 0
configuration file is /etc/exim4/exim4.conf
log selector = 040d99d8
trusted user
admin user
LOG: MAIN
Unfrozen by forced delivery
search_open: ldapm "NULL"
search_find: file="NULL"
key="user="cn=admin,dc=test,dc=com" pass=admin ldap://localhost:389/
dc=test,dc=com?mail?sub?(&(uid=root))" partial=-1 affix=NULL starflags=
LRU list:
internal_search_find: file="NULL"
type=ldapm key="user="cn=admin,dc=test,dc=com" pass=admin ldap://loc
lhost:389/dc=test,dc=com?mail?sub?(&(uid=root))"
database lookup required for user="cn=admin,dc=test,dc=com" pass=admin
ldap://localhost:389/dc=test,dc=com?mail?sub?(&(uid=root))
LDAP parameters: user=cn=admin,dc=test,dc=com pass=admin size=0 time=0
connect=-1 dereference=0
perform_ldap_search: ldapm URL ="ldap://localhost:389/dc=test,dc=com?m
il?sub?(&(uid=root))" server=NULL port=0 sizelimit=0 timelimit=0
tcplimit=-1
after ldap_url_parse: host=localhost port=389
ldap_initialize with URL ldap://localhost:389/
initialized for LDAP (v3) server localhost:389
LDAP_OPT_X_TLS_TRY set
binding with user=cn=admin,dc=test,dc=com password=admin
Start search
search ended by ldap_result yielding 101
ldap_parse_result yielded 0: Success
LDAP search: no results
lookup failed
search_open: lsearch "/etc/aliases"
search_find: file="/etc/aliases"
key="root" partial=-1 affix=NULL starflags=0
LRU list:
9/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="root"
file lookup required for root
in /etc/aliases
lookup yielded: test
search_open: ldapm "NULL"
cached open
search_find: file="NULL"
key="user="cn=admin,dc=test,dc=com" pass=admin ldap://localhost:389/
dc=test,dc=com?mail?sub?(&(uid=test))" partial=-1 affix=NULL starflags=
LRU list:
9/etc/aliases
End
internal_search_find: file="NULL"
type=ldapm key="user="cn=admin,dc=test,dc=com" pass=admin ldap://loc
lhost:389/dc=test,dc=com?mail?sub?(&(uid=test))"
database lookup required for user="cn=admin,dc=test,dc=com" pass=admin
ldap://localhost:389/dc=test,dc=com?mail?sub?(&(uid=test))
LDAP parameters: user=cn=admin,dc=test,dc=com pass=admin size=0 time=0
connect=-1 dereference=0
perform_ldap_search: ldapm URL ="ldap://localhost:389/dc=test,dc=com?m
il?sub?(&(uid=test))" server=NULL port=0 sizelimit=0 timelimit=0
tcplimit=-1
after ldap_url_parse: host=localhost port=389
re-using cached connection to LDAP server localhost:389
Start search
ldap_result loop
LDAP entry loop
LDAP attr loop mail:test
search ended by ldap_result yielding 101
ldap_parse_result yielded 0: Success
LDAP search: returning: test
lookup yielded: test
search_open: lsearch "/etc/aliases"
cached open
search_find: file="/etc/aliases"
key="test" partial=-1 affix=NULL starflags=0
LRU list:
9/etc/aliases
End
internal_search_find: file="/etc/aliases"
type=lsearch key="test"
file lookup required for test
in /etc/aliases
lookup failed
LOG: MAIN
** test@??? <root@???>: Unrouteable addre
s
search_tidyup called
unbind LDAP connection to localhost:389
LOG: MAIN
Frozen (delivery error message)
search_tidyup called
search_tidyup called
>>>>>>>>>>>>>>>> Exim pid=29960 terminating with rc=0 >>>>>>>>>>>>>>>>
Sorry for lond mail.
Any help appreciated....