[Dovecot] Shared mailboxes with dovecot.
Hi, first of all for forgive me for my english.
I have several questions.
There are 2 user/passwd databases in my setup - ldap and mysql. when i login into one user with telnet 127.0.0.1 143 and share inbox to some users - records in dict-file apears? but if i delete some acls - records indict-file stays same.
I see in error.log such errors. can somebody explain what do dovecot list shared folder (what files is looking for, how it see variables %u and %%u, ...)
Aug 26 15:44:19 imap(jack@badmltd.dn.ua): Error: Namespace 'shared//': mkdir(/var/run/dovecot/user-not-found/@badmltd.dn.ua) failed: Permission denied (euid=47(mailnull) egid=12(mail) missing +w perm: /var/run/dovecot, euid is not dir owner) Aug 26 15:44:53 imap(admin@badmltd.dn.ua): Error: Namespace 'shared/shared/': mkdir(/var/run/dovecot/user-not-found/shared@badmltd.dn.ua) failed: Permission denied (euid=47(mailnull) egid=12(mail) missing +w perm: /var/run/dovecot, euid is not dir owner) Aug 26 15:44:56 imap(test@badmltd.dn.ua): Error: Namespace 'shared/shared/': mkdir(/var/run/dovecot/user-not-found/shared@badmltd.dn.ua) failed: Permission denied (euid=47(mailnull) egid=12(mail) missing +w perm: /var/run/dovecot, euid is not dir owner) Aug 26 15:46:36 imap(jack@badmltd.dn.ua): Error: Namespace 'shared//': mkdir(/var/run/dovecot/user-not-found/@badmltd.dn.ua) failed: Permission denied (euid=47(mailnull) egid=12(mail) missing +w perm: /var/run/dovecot, euid is not dir owner) Aug 26 15:48:04 imap(jack@badmltd.dn.ua): Error: Namespace 'shared//': mkdir(/var/run/dovecot/user-not-found/@badmltd.dn.ua) failed: Permission denied (euid=47(mailnull) egid=12(mail) missing +w perm: /var/run/dovecot, euid is not dir owner)
*********************debug.log*******************
Aug 26 15:48:03 auth: Debug: master out: USER 1 jack@badmltd.dn.ua
home=/var/spool/vmail/domains/badmltd.dn.ua/jack uid=47 gid=12
Aug 26 15:48:03 imap: Debug: Loading modules from directory: /usr/lib/dovecot
Aug 26 15:48:03 imap: Debug: Module loaded:
/usr/lib/dovecot/lib01_acl_plugin.so
Aug 26 15:48:03 imap: Debug: Module loaded:
/usr/lib/dovecot/lib02_imap_acl_plugin.so
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: Effective uid=47, gid=12,
home=/var/spool/vmail/domains/badmltd.dn.ua/jack
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: Namespace : type=private,
prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: maildir++:
root=/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir, index=, control=,
inbox=/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: initializing backend
with data: vfile
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: acl username =
jack@badmltd.dn.ua
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: owner = 1
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: Global ACL
directory: (null)
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: Namespace : type=shared,
prefix=shared/%n/, sep=/, inbox=no, hidden=no, list=children, subscriptions=no
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: shared:
root=/var/run/dovecot, index=, control=, inbox=
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: initializing backend
with data: vfile
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: acl username =
jack@badmltd.dn.ua
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: owner = 0
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: Global ACL
directory: (null)
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: file
/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/.Trash/dovecot-acl not
found
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: file
/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/.&BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1-/dovecot-
acl not found
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: file
/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/.Sent/dovecot-acl not
found
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: file
/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/.&BCcENQRABD0EPgQyBDgEOgQ4-/dovecot-
acl not found
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: file
/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/dovecot-acl not found
Aug 26 15:48:03 auth: Debug: master in: USER 1 zakaz@badmltd.dn.ua
service=lib-storage
Aug 26 15:48:03 auth: Debug: sql(zakaz@badmltd.dn.ua): SELECT home, uid, gid
FROM users WHERE id = 'zakaz' AND active = 'Y'
Aug 26 15:48:03 auth: Debug: master out: USER 1 zakaz@badmltd.dn.ua
home=/var/spool/vmail/domains/badmltd.dn.ua/zakaz uid=47 gid=12
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: auth input:
zakaz@badmltd.dn.ua home=/var/spool/vmail/domains/badmltd.dn.ua/zakaz uid=47
gid=12
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: maildir++:
root=/var/spool/vmail/domains/badmltd.dn.ua/zakaz/Maildir,
index=/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/shared/zakaz@badmltd.dn.ua,
control=, inbox=/var/spool/vmail/domains/badmltd.dn.ua/zakaz/Maildir
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: initializing backend
with data: vfile
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: acl username =
jack@badmltd.dn.ua
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: owner = 0
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: Global ACL
directory: (null)
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: reading file
/var/spool/vmail/domains/badmltd.dn.ua/zakaz/Maildir/dovecot-acl
Aug 26 15:48:03 auth: Debug: master in: USER 2 test@badmltd.dn.ua
service=lib-storage
Aug 26 15:48:03 auth: Debug: sql(test@badmltd.dn.ua): SELECT home, uid, gid
FROM users WHERE id = 'test' AND active = 'Y'
Aug 26 15:48:03 auth: Debug: ldap(test@badmltd.dn.ua): user search:
base=dc=Donetsk, dc=Office, dc=badm, dc=com scope=subtree
filter=(&(objectclass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))
(mail=test@badmltd.dn.ua)) fields=
Aug 26 15:48:03 auth: Debug: ldap(test@badmltd.dn.ua): result:
objectClass(?unknown?)= cn(?unknown?)= givenName(?unknown?)=
distinguishedName(?unknown?)= instanceType(?unknown?)= whenCreated(?unknown?)=
whenChanged(?unknown?)= displayName(?unknown?)= uSNCreated(?unknown?)=
uSNChanged(?unknown?)= name(?unknown?)= objectGUID(?unknown?)=
userAccountControl(?unknown?)= primaryGroupID(?unknown?)=
objectSid(?unknown?)= sAMAccountName(?unknown?)= sAMAccountType(?unknown?)=
userPrincipalName(?unknown?)= objectCategory(?unknown?)=
dSCorePropagationData(?unknown?)= lastLogonTimestamp(?unknown?)=
mail(?unknown?)=
Aug 26 15:48:03 auth: Debug: master out: USER 2 test@badmltd.dn.ua
home=/var/spool/vmail/domains/badmltd.dn.ua/test
mail=/var/spool/vmail/domains/badmltd.dn.ua/test/Maildir
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: auth input:
test@badmltd.dn.ua home=/var/spool/vmail/domains/badmltd.dn.ua/test
mail=/var/spool/vmail/domains/badmltd.dn.ua/test/Maildir
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: maildir++:
root=/var/spool/vmail/domains/badmltd.dn.ua/test/Maildir,
index=/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/shared/test@badmltd.dn.ua,
control=, inbox=/var/spool/vmail/domains/badmltd.dn.ua/test/Maildir
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: initializing backend
with data: vfile
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: acl username =
jack@badmltd.dn.ua
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl: owner = 0
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: Global ACL
directory: (null)
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: acl vfile: reading file
/var/spool/vmail/domains/badmltd.dn.ua/test/Maildir/.kde/dovecot-acl
Aug 26 15:48:03 auth: Debug: master in: USER 3 @badmltd.dn.ua
service=lib-storage
Aug 26 15:48:03 auth: Debug: sql(@badmltd.dn.ua): SELECT home, uid, gid FROM
users WHERE id = '' AND active = 'Y'
Aug 26 15:48:03 auth: Debug: ldap(@badmltd.dn.ua): user search:
base=dc=Donetsk, dc=Office, dc=badm, dc=com scope=subtree
filter=(&(objectclass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))
(mail=@badmltd.dn.ua)) fields=
Aug 26 15:48:03 auth: Debug: master out: NOTFOUND 3
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: auth input:
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: maildir++:
root=/var/run/dovecot/user-not-found/@badmltd.dn.ua, index=, control=,
inbox=/var/run/dovecot/user-not-found/@badmltd.dn.ua
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: Namespace shared//:
Permission lookup failed from /var/run/dovecot/user-not-found/@badmltd.dn.ua
Aug 26 15:48:03 imap(jack@badmltd.dn.ua): Debug: Namespace shared//: Using
permissions from /var/run/dovecot/user-not-found/@badmltd.dn.ua: mode=0700
gid=-1
Aug 26 15:48:04 imap(jack@badmltd.dn.ua): Debug: acl vfile: file
/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/.shared.test.kde/dovecot-
acl not found
Aug 26 15:48:04 imap(jack@badmltd.dn.ua): Debug: acl vfile: file
/var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir/.shared.zakaz.INBOX/dovecot-
acl not found
Aug 26 15:48:08 imap(jack@badmltd.dn.ua): Debug: Namespace : Using permissions
from /var/spool/vmail/domains/badmltd.dn.ua/jack/Maildir: mode=0720 gid=-1
my setup:
dovecot -n
# 2.0.0: /etc/dovecot/dovecot.conf # OS: Linux 2.6.33.8-149.fc13.i686.PAE i686 Fedora release 13 (Goddard) ext4 auth_debug = yes auth_debug_passwords = yes auth_mechanisms = plain login auth_verbose = yes auth_verbose_passwords = plain debug_log_path = /var/log/dovecot/debug.log disable_plaintext_auth = no first_valid_gid = 12 first_valid_uid = 47 info_log_path = /var/log/dovecot/info.log log_path = /var/log/dovecot/dovecot.log mail_access_groups = mail mail_debug = yes mail_gid = 12 mail_location = maildir:/var/spool/vmail/domains/%d/%n/Maildir mail_plugins = acl mail_uid = 47 mbox_write_locks = fcntl namespace { inbox = yes location = prefix = separator = / type = private } namespace { list = children location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u prefix = shared/%%n/ separator = / subscriptions = no type = shared } passdb { args = /etc/dovecot/dovecot-sql.conf.ext driver = sql } passdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap } plugin { acl = vfile acl_shared_dict = file:/tmp/shared-mailboxes } postmaster_address = postmaster@badmltd.dn.ua protocols = imap pop3 service auth-worker { user = $default_internal_user } service auth { unix_listener auth-userdb { mode = 0666 user = mailnull } } ssl_cert =
# cat /tmp/shared-mailboxes shared/shared-boxes/user/admin@badmltd.dn.ua/test@badmltd.dn.ua 1 shared/shared-boxes/user/admin@badmltd.dn.ua/zakaz@badmltd.dn.ua 1 shared/shared-boxes/user/jack@badmltd.dn.ua/zakaz@badmltd.dn.ua 1 shared/shared-boxes/user/test@badmltd.dn.ua/zakaz@badmltd.dn.ua 1 shared/shared-boxes/user/jack@badmltd.dn.ua/test@badmltd.dn.ua 1
# cat /etc/dovecot/dovecot-sql.conf.ext driver = mysql connect = host=localhost dbname=****** user=**** password=***** default_pass_scheme=plain password_query = SELECT passwd as password FROM users WHERE id = '%n' AND active = 'Y' user_query = SELECT home, uid, gid FROM users WHERE id = '%n' AND active = 'Y' #password_query = SELECT crypt as password FROM users WHERE id = '%n' AND domain = '%d' AND active = 'Y' #user_query = SELECT home, uid, gid FROM users WHERE id = '%n' AND domain = '%d' AND active = 'Y'
# cat /etc/dovecot/dovecot-ldap.conf.ext hosts = 10.1.11.3:3268 172.27.1.2:3268 dn = cn=****,cn=Users,dc=****,dc=Office,dc=****,dc=com dnpass = ***** auth_bind = yes ldap_version = 3 base = dc=*****k, dc=Office, dc=****, dc=com deref = searching scope = subtree
user_attrs = =home=/var/spool/vmail/domains/%d/%n,=mail=/var/spool/vmail/domains/%d/%n/Maildir
user_filter = (&(objectclass=user)(! (userAccountControl:1.2.840.113556.1.4.803:=2))(mail=%u)) pass_filter = (&(objectclass=user)(! (userAccountControl:1.2.840.113556.1.4.803:=2))(mail=%u))
# cat /var/spool/vmail/domains/badmltd.dn.ua/zakaz/Maildir/dovecot-acl user=admin@badmltd.dn.ua lrws user=jack@badmltd.dn.ua lrws user=test@badmltd.dn.ua lrws
Again, what does mean this strings?
Aug 26 15:48:03 auth: Debug: master in: USER 1 zakaz@badmltd.dn.ua
service=lib-storage
Aug 26 15:48:03 auth: Debug: master in: USER 2 test@badmltd.dn.ua
service=lib-storage
Aug 26 15:48:03 auth: Debug: master in: USER 2 test@badmltd.dn.ua
service=lib-storage
Aug 26 15:48:03 auth: Debug: master out: USER 2 test@badmltd.dn.ua
service=lib-storage
Aug 26 15:48:03 auth: Debug: master in: USER 3 @badmltd.dn.ua
service=lib-storage
Aug 26 15:48:03 auth: Debug: master out: NOTFOUND 3
Why does dovecot iterates it?
On Thu, 2010-08-26 at 16:13 +0300, Mihajlin Evgenij wrote:
Hi, first of all for forgive me for my english.
I have several questions.
- There are 2 user/passwd databases in my setup - ldap and mysql. when i login into one user with telnet 127.0.0.1 143 and share inbox to some users - records in dict-file apears? but if i delete some acls - records indict-file stays same.
Probably a bug.
- I see in error.log such errors. can somebody explain what do dovecot list shared folder (what files is looking for, how it see variables %u and %%u, ...)
Aug 26 15:44:19 imap(jack@badmltd.dn.ua): Error: Namespace 'shared//': mkdir(/var/run/dovecot/user-not-found/@badmltd.dn.ua) failed: Permission denied (euid=47(mailnull) egid=12(mail) missing +w perm: /var/run/dovecot, euid is not dir owner)
It looks as if it's trying to access an empty user's ("@badmltd.dn.ua") mailbox ("shared//", it typically should access shared/username/box" or something).
One annoying thing here is that it even gives this error message when client attempts to access invalid mailboxes. Should fix it some day.
Aug 26 15:44:53 imap(admin@badmltd.dn.ua): Error: Namespace 'shared/shared/': mkdir(/var/run/dovecot/user-not-found/shared@badmltd.dn.ua) failed: Permission denied (euid=47(mailnull) egid=12(mail) missing +w perm: /var/run/dovecot, euid is not dir owner)
Again, it's trying to access "shared@badmltd.dn.ua" user's mails. That user probably doesn't exist either?
How are you trying to access these mailboxes? With an imap client? Try testing first by talking IMAP protocol directly and only after that works try IMAP clients.
http://wiki2.dovecot.org/TestInstallation gives some commands. Basically you should get these working:
a select shared/username/mailbox b list "" shared/*
On Thu, 2010-08-26 at 16:13 +0300, Mihajlin Evgenij wrote:
mail_location = maildir:/var/spool/vmail/domains/%d/%n/Maildir namespace { location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u
These don't match. You're now using home dir in one but not the other.
user_attrs = =home=/var/spool/vmail/domains/%d/%n,=mail=/var/spool/vmail/domains/%d/%n/Maildir
Also you're here overriding mail_location. To make this simple:
- Remove "mail=.." from user_attrs
- Set mail_location = maildir:~/Maildir
participants (2)
-
Mihajlin Evgenij
-
Timo Sirainen