[Dovecot] Problems with master user

Andrea Mistrali am at am.cx
Thu Apr 12 18:35:15 EEST 2012


Hi to all!
I’m trying to setup master users, but I have some problems. Namely I can authenticate, but after it I cannot access INBOX or other mailboxes of the user.

My configuration is:

passdb {
  driver = ldap
  args = /etc/dovecot/ldap-passdb.conf
}

passdb {
  driver = sql
  args = /etc/dovecot/sql.conf
}

passdb {
    driver = passwd-file
    args = /etc/dovecot/passwd.masterusers
    master = yes
    pass = yes
}

userdb {
  driver = sql
  args = /etc/dovecot/sql.conf
}

(I look up for auth in LDAP server first, if it fails I look up in DB, else I check for master user)

and relevant files are

/etc/dovecot/sql.conf
——————————
password_query = SELECT fullusername as user, \
                 password, \
                 uid AS userdb_uid, \
                 gid AS userdb_gid, \ 
                 home AS userdb_home, \
                 mail AS userdb_mail, \
                 groups as userdb_acl_groups, \
                 quota_rule as userdb_quota_rule \
                 FROM pd_users_full WHERE \
                 username = '%n' AND \
                 domain = '%d' AND \
                 external_auth IS FALSE AND \
                 master_user IS FALSE AND \
                 %Ls_ok IS TRUE

user_query = SELECT fullusername as user, \
             uid, \ 
             gid, \
             home, \
             mail, \
             groups as acl_groups, \
             quota_rule \
             FROM pd_users_full WHERE \
             username = '%n' AND \
             domain = '%d' AND \
             master_user IS FALSE

iterate_query = SELECT fullusername as username, fullusername as user \
                FROM pd_users_full where master_user IS FALSE ORDER BY domain,username

/etc/dovecot/ldap-passdb.conf
——————————————
uris = ldap://dioniso.cube.lan
base = cn=users,dc=cube,dc=lan
auth_bind = yes
auth_bind_userdn = uid=%n,cn=users,dc=cube,dc=lan

pass_attrs = uid=username, \
             userPassword=password, \
             # uidNumber=userdb_uid, \
             # =userdb_home=/var/mail/cubeholding.com/%Lu, \
             # =userdb_domain=cubeholding.com, \
             # =userdb_mail=maildir:~/maildir/:INBOX=~/maildir/INBOX:LAYOUT=fs:INDEX=~/indexes/

pass_filter = (&(objectClass=posixAccount)(uid=%n)(mail=*@%d))

# Attributes and filter to get a list of all users
# iterate_attrs = uid=username
iterate_attrs = uid=user
iterate_filter = (&(objectClass=posixAccount)(mail=*@%d))


If I test with doveadm auth and doveadm user I receive this:

# doveadm auth -x service=imap andre at am.cx\*master at am.cx XXXXXX
passdb: andre at am.cx*master at am.cx auth succeeded
extra fields:
  user=andre at am.cx

# doveadm user andre at am.cx                                       
userdb: andre at am.cx
  uid       : 10010
  gid       : 8
  home      : /var/mail/am.cx/andre
  mail      : maildir:~/maildir:INBOX=~/maildir/INBOX:LAYOUT=fs:INDEX=~/indexes/
  acl_groups: 
  quota_rule: *:storage=10G

and in log files I see:

20120412 17:31:26 auth: Info: passdb(master at am.cx,master): Master user logging in as andre at am.cx
20120412 17:31:26 auth: Info: ldap(andre at am.cx): invalid credentials (given password: XXXXXX)

but if I try the real thing:

# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE ACL QUOTA NAMESPACE STARTTLS AUTH=PLAIN AUTH=LOGIN AUTH=GSSAPI] Dovecot ready.
0 login andre at am.cx*master at am.cx XXXXXX
0 OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE ACL QUOTA NAMESPACE COMPRESS=DEFLATE QUOTA ACL RIGHTS=texk] Logged in
0 select INBOX
0 NO [SERVERBUG] Internal error occurred. Refer to server log for more information. [2012-04-12 17:33:15]

and in log file I have:

20120412 17:34:25 auth: Info: passdb(master at am.cx,127.0.0.1,master): Master user logging in as andre at am.cx
20120412 17:34:25 auth: Info: ldap(andre at am.cx,127.0.0.1): invalid credentials (given password: silmaril)
20120412 17:34:25 imap-login: Info: Login: pid=1673, <andre at am.cx>, 127.0.0.1/127.0.0.1, PLAIN, secured
20120412 17:34:47 imap(andre at am.cx): Error: Opening INBOX failed: Mailbox doesn't exist: INBOX

Can someone tell me what is wrong in my setup?

TIA
A.


More information about the dovecot mailing list