[Dovecot] login w/ IMAP & LDAP

Bob Hall rjhjr at cox.net
Tue Aug 12 23:40:35 EEST 2003


I'm getting 
	imap-login: Internal login failure: bob
whenever I try to check mail. I'm new to mail server setup, 
new to IMAP, and I don't know a heck of a lot about authentication 
schemes. 

I've set up Dovecot as an IMAP server on FreeBSD 4.8. I've got 
OpenLDAP running on the same system. Users will access mail via 
Eudora on Windows and Macs, so that's how I'm testing. If I try 
to test Dovecot using IMAP commands via telnet, Dovecot tells me 
	LOGIN BAD Error in IMAP command received by server.
I also can't telnet via localhost; I have to specify the host name, 
so I'm connecting via the host's external interface. I have no 
problem connecting to localhost on ports not used by Dovecot.

So I have two questions:
1) How do I correct my configuration to make login successful?
2) How can I test Dovecot without using an MUA? If I have to 
   use an MUA, I can't distinguish between errors in the MUA and 
   errors in the IMAP server.

Thanks for any help with these two. Configuration follows.

Eudora: 
Server configuration: IMAP
IMAP Mailbox Location Prefix: /var/mail/bob/Mail
Authentication Style: passwords

dovecot.conf
----------------
protocols = imap imaps
imap_listen = *:143
login_user = dovecot
default_mail_env = mbox:/var/mail/%u/Mail
auth_userdb = ldap /usr/local/etc/dovecot-ldap.conf
auth_passdb = ldap /usr/local/etc/dovecot-ldap.conf
auth_user = dovecot

dovecot-ldap.conf
-------------------
hosts = localhost
dn = cn=dovecot,dc=domain,dc=tld
dnpass = **********
ldap_version = 3
base = ou=accounts,dc=domain,dc=tld
deref = never
scope = subtree
user_attrs = uid
user_filter = (&(objectClass=inetOrgPerson)(uid=%u))
pass_attrs = uid,userPassword
pass_filter = (&(objectClass=inetOrgPerson)(uid=%u))
default_pass_scheme = PLAIN

slapd.conf
-----------------
password-hash {CLEARTEXT}

If I change this last to CRYPT (comment out the dovecot-ldap 
default_pass_scheme and change the slapd.conf password-hash to {CRYPT} 
and re-enter the password into LDAP), I get the same error. I have no 
problem accessing the LDAP data from the command line.

If I comment out the dovecot-ldap.conf user_filter and pass_filter, I get
	dovecot-auth: ldap(bob): unknown user
I interpret as meaning that the user_filter and pass_filter are necessary.

Bob Hall


More information about the dovecot mailing list