[Dovecot] Authentication Failure (newbie)
Greetings,
I'm am learning about running a mail server and I set up a brand new Ubuntu 14.04 server with postfix and dovecot. I had some initial problems with dovecot not starting, and then with not having proper permissions/access to the various directories and files and pipes, etc, and in the process starting to learn how this thing works.
After searching in web-land I seem to have overcome those issues and dovecot and postfix both start and accept connections now (http://wiki2.dovecot.org/TestPop3Installation).
However when I check to see if I can authenticate I get Authentication Failed. At the time of these login attempts there are no messages added to syslog or mail.log, dovecot log entries are below.
Note I redacted my test user and password values to 'xxxxx', and my domain value to 'domain.com'. Also I'm testing with my plain text password, but I've tried using AUTH PLAIN <base64 encoded uid/pwd>. I have also tried the setup with a default auth domain, and I've tried authenticating with and without the domain name as part of the user name, with the same results. I added the debug settings and disable_plaintext_auth = no to try to solve this issue.
Here is my test command set:
xxxxx@apacweb:~$ sudo doveadm user xxxxx field valueuserdb lookup: user xxxxx doesn't exist
and :
xxxxx@apacweb:~$ telnet localhost 110 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. +OK Dovecot (Ubuntu) ready. user xxxxx +OK pass xxxxx -ERR [AUTH] Authentication failed.
Here is a cut from the dovecot log:
2014-06-08 01:22:10 auth: Error: passwd-file(xxxxx): stat(uid=vmail gid=vmail home=/home/vmail//xxxxx /etc/dovecot/users) failed: Address family not supported by protocol
I figure this is the root cause of this issue and the solution to it is supposedly to tell dovecot to not listen on IPv6 (listen = *), but I did that and it didn't help (see config).
Here is a cut from the dovecot.info log:
2014-06-08 00:16:25 auth: Debug: auth client connected (pid=3131)
2014-06-08 01:22:10 auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth 2014-06-08 01:22:10 auth: Debug: Read auth token secret from /var/run/dovecot//auth-token-secret.dat 2014-06-08 01:22:10 auth: Debug: passwd-file /etc/dovecot/passwd: Read 1 users in 0 secs 2014-06-08 01:22:10 auth: Debug: master in: USER 1 xxxxx service=doveadm 2014-06-08 01:22:10 auth: Debug: userdb out: NOTFOUND 1
Here is my dovecot config:
# 2.2.9: /etc/dovecot/dovecot.conf # OS: Linux 3.13.0-24-generic x86_64 Ubuntu 14.04 LTS ext4 auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain cram-md5 auth_verbose = yes base_dir = /var/run/dovecot/ disable_plaintext_auth = no info_log_path = /var/log/dovecot.info listen = * log_path = /var/log/dovecot log_timestamp = "%Y-%m-%d %H:%M:%S " mail_location = maildir:/home/vmail/%d/%n/Maildir passdb { args = /etc/dovecot/passwd driver = passwd-file } protocols = imap pop3 service auth { executable = /usr/lib/dovecot/auth unix_listener /var/spool/postfix/private/auth-client { group = postfix mode = 0666 user = postfix } unix_listener auth-userdb { group = postfix mode = 0777 user = postfix } user = vmail } service imap-login { chroot = login executable = /usr/lib/dovecot/imap-login user = dovecot } service imap { executable = /usr/lib/dovecot/imap } service pop3-login { chroot = login executable = /usr/lib/dovecot/pop3-login inet_listener pop3 { address = * port = 110 } inet_listener pop3s { address = * port = 995 } user = dovecot } service pop3 { executable = /usr/lib/dovecot/pop3 } ssl = required ssl_cert = </etc/ssl/certs/smtpd.crt ssl_key = </etc/ssl/private/smtpd.key userdb { args = uid=vmail gid=vmail home=/home/vmail/%d/%n /etc/dovecot/users driver = passwd-file } valid_chroot_dirs = /var/spool/vmail protocol pop3 { pop3_uidl_format = %08Xu%08Xv }
I'm sure I've done something stupid, but after thrashing about for some days I haven't been able to figure out what it is.
Regards, Danny
Hi Danny
possibly it has to do with the valid_chroot_dirs option, so that your userdb is not able to find the users file?
http://wiki2.dovecot.org/Chrooting?highlight=%28valid_chroot_dirs%29
Regards Daniel
Daniel,
Thanks for the reply. After reading up on that link, I removed all chroot settings, letting dovecot use its defaults. I figure that should open things up as much as possible for testing. My configuration now looks like this, but I get no change in behavior:
# 2.2.9: /etc/dovecot/dovecot.conf # OS: Linux 3.13.0-24-generic x86_64 Ubuntu 14.04 LTS ext4 auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain cram-md5 auth_verbose = yes base_dir = /var/run/dovecot/ disable_plaintext_auth = no info_log_path = /var/log/dovecot.info listen = * log_path = /var/log/dovecot log_timestamp = "%Y-%m-%d %H:%M:%S " mail_location = maildir:/home/vmail/%d/%n/Maildir passdb { args = /etc/dovecot/passwd driver = passwd-file } protocols = imap pop3 service auth { executable = /usr/lib/dovecot/auth unix_listener /var/spool/postfix/private/auth-client { group = postfix mode = 0666 user = postfix } unix_listener auth-userdb { group = postfix mode = 0777 user = postfix } user = vmail } service imap-login { executable = /usr/lib/dovecot/imap-login user = dovecot } service imap { executable = /usr/lib/dovecot/imap } service pop3-login { executable = /usr/lib/dovecot/pop3-login inet_listener pop3 { address = * port = 110 } inet_listener pop3s { address = * port = 995 } user = dovecot } service pop3 { executable = /usr/lib/dovecot/pop3 } ssl = required ssl_cert = </etc/ssl/certs/smtpd.crt ssl_key = </etc/ssl/private/smtpd.key userdb { args = uid=vmail gid=vmail home=/home/vmail/%d/%n /etc/dovecot/users driver = passwd-file } protocol pop3 { pop3_uidl_format = %08Xu%08Xv }
What does the content your users file look like? Is it in the correct format?
http://wiki2.dovecot.org/AuthDatabase/PasswdFile
Also looks like you need to move some arguments from args to default_fields in your userdb section.
Regards Daniel
Daniel,
Nice catch. The arguments all being in the args = instead of the default_fields = for the userdb section was the problem. A newbie RTFM incident for sure.
Thank you very much for your help. Now I'm off to see if I can break it again getting all the other mail layers added!
Kind regards, Danny
On 06/08/2014 06:29 AM, Daniel Parthey wrote:
What does the content your users file look like? Is it in the correct format?
http://wiki2.dovecot.org/AuthDatabase/PasswdFile
Also looks like you need to move some arguments from args to default_fields in your userdb section.
Regards Daniel
participants (2)
-
Daniel Parthey
-
Danny Gorton