You are not logged in.

#1 2014-04-30 21:59:42

Nycroth
Member
Registered: 2014-04-16
Posts: 7

[Solved] Dovecot imap-login fails

I have been working on this for hours and I have little idea what is wrong. I have dovecot setup to authenticate via PAM. I am sure that the PAM authentication is correct as a wrong password returns a bad auth error. However, when the initial authentication happens it feels like PAM isn't returning my UID.

Config:

protocols = imap

mail_location = maildir:~/.mail

passdb {
    driver = pam
    #<DEBUG>
    args = failure_show_msg=yes dovecot
    #</DEBUG>
}

ssl = required
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
ssl_cipher_list = ECDHE-ECDSA-AES256-GCM-SHA384:HIGH

#<DEBUG>
auth_verbose=yes
auth_debug=yes
#</DEBUG>

Error:

Apr 30 21:43:39 example.org dovecot[20497]: auth: Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Apr 30 21:43:39 example.org dovecot[20497]: auth: Debug: Read auth token secret from /var/run/dovecot/auth-token-secret.dat
Apr 30 21:43:39 example.org dovecot[20497]: auth: Debug: auth client connected (pid=20500)
Apr 30 21:43:40 example.org dovecot[20497]: auth: Debug: client in: AUTH        1        PLAIN        service=imap        secured        session=gbQRcUn41gDH1CFX        lip=192.168.1.1        rip=172.16.1.1        lport=993        rport=35286        resp=<hidden>
Apr 30 21:43:40 example.org dovecot[20497]: auth-worker(20503): Debug: Loading modules from directory: /usr/lib/dovecot/modules/auth
Apr 30 21:43:40 example.org dovecot[20497]: auth-worker(20503): Debug: pam(myusername,172.16.1.1): lookup service=dovecot
Apr 30 21:43:40 example.org dovecot[20497]: auth-worker(20503): Debug: pam(myusername,172.16.1.1): #1/1 style=1 msg=Password:
Apr 30 21:43:40 example.org dovecot[20497]: auth: Debug: client passdb out: OK        1        user=myusername
Apr 30 21:43:40 example.org dovecot[20497]: auth: Debug: master in: REQUEST        158597121        20500        1        8026dcae28bb986805dfea459a9879da        session_pid=20504        request_auth_token
Apr 30 21:43:40 example.org dovecot[20497]: auth: Debug: master userdb out: USER        158597121        myusername                auth_token=de32f97064bc1c4215b205d41ad36fd9eb8d466a
Apr 30 21:43:40 example.org dovecot[20497]: imap-login: Login: user=<myusername>, method=PLAIN, rip=172.16.1.1, lip=192.168.1.1, mpid=20504, TLS, session=<gbQRcUn41gDH1CFX>
Apr 30 21:43:40 example.org dovecot[20497]: imap(keller): Error: user myusername: Couldn't drop privileges: User is missing UID (see mail_uid setting)
Apr 30 21:43:40 example.org dovecot[20497]: imap(keller): Error: Internal error occurred. Refer to server log for more information.

/ect/pam.d/dovecot

auth    required pam_unix.so nullok
account required pam_unix.so

Solution: Authentication is not authorization! I didn't have a userdb setup.

Added to /ect/dovecot/dovecot.conf

userdb {
    driver = passwd
}

Last edited by Nycroth (2014-04-30 22:34:45)

Offline

Board footer

Powered by FluxBB