Michael Stilkerich
2011-Oct-22 13:16 UTC
[Dovecot] setacl fails - does not find dovecot-acl file
Hi, I'm using dovecot 2.0.13 that ships with Ubuntu 11.10. I tried setting up a shared namespace as documented in the wiki to enable the sharing of a mailbox between two users. I have a Maildir(++) directory for each user. Each user has a system account. The Maildir of each user is owned by the user's system account and group read/writable by the group mail (hence mail_access_groups=mail). Relevant parts of my config: mail_plugins = acl mail_location = maildir:/home/dovecot/%u mail_access_groups = mail namespace { type = private separator = / prefix inbox = yes hidden = no subscriptions = yes } namespace { type = shared separator = / prefix = shared/%%u/ location = maildir:/home/dovecot/%%u:INDEX=/home/dovecot/%u/shared/%%u subscriptions = no list = children } protocol imap { mail_plugins = $mail_plugins imap_acl } plugin { acl = vfile } plugin { acl_shared_dict = file:/home/dovecot/shared-mailboxes } When I try to create an ACL in a telnet session, the command fails with an internal error. The log shows: dovecot: imap(michael): Error: fstat(/home/dovecot/michael/.test/dovecot-acl.lock) failed: No such file or directory dovecot: imap(michael): Error: file_dotlock_open(/home/dovecot/michael/.test/dovecot-acl) failed: No such file or directory The error occurs whether a (manually created) dovecot-acl file exists or not. The dovecot-acl.lock file is created by not removed afterwards. Subsequent setacl commands will timeout waiting for the lock to be released until I delete it manually. If I create the dovecot-acl file manually and provide access to another user, the getacl command will correctly show the permissions and the other user can access the folder. setacl will still fail to modify the acl file, however (same error). Another thing that irritates me is that dovecot seems to use the dotlock locking method, although I explicitly set lock_method to fcntl (also tried flock, same behavior). I'm not using chroot. I appreciate any help to get this sorted out. Thanks, Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4480 bytes Desc: S/MIME Cryptographic Signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20111022/3001cc0f/attachment-0004.bin>
Michael Stilkerich
2011-Oct-22 17:42 UTC
[Dovecot] setacl fails - does not find dovecot-acl file
Hi again, On 22.10.2011 15:16, Michael Stilkerich wrote:> When I try to create an ACL in a telnet session, the command fails with > an internal error. The log shows: > > dovecot: imap(michael): Error: > fstat(/home/dovecot/michael/.test/dovecot-acl.lock) failed: No such file > or directory > dovecot: imap(michael): Error: > file_dotlock_open(/home/dovecot/michael/.test/dovecot-acl) failed: No > such file or directoryI found that the problem seems to be the try_create_lock_hardlink() function, which is used to create the lock file. I don't now why it doesn't work, but if I modify the code of dotlock_create() to always use try_create_lock_excl() instead ignoring the setting of use_excl_lock in the dotlock_settings structure, it works just fine for me. I noticed in the log that the issue not only occurs with the dovecot-acl files but with other files, too, namely the dovecot.index.log and my acl_shared_dict file. Looking at the static dotlock_settings structure in the acl-file backend, I don't see how its use_excl_lock could possible be set to 1 by the configuration (i.e., it doesn't seem that the dotlock_use_excl configuration option is considered). For the maildirlock, an environment variable "DOTLOCK_USE_EXCL" is checked instead of the config setting. I'm not sure whether it is intentional that the hardlink variant is generally used in these cases. -Michael -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4480 bytes Desc: S/MIME Cryptographic Signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20111022/740ba980/attachment-0004.bin>
Timo Sirainen
2011-Nov-04 19:47 UTC
[Dovecot] setacl fails - does not find dovecot-acl file
On Sat, 2011-10-22 at 15:16 +0200, Michael Stilkerich wrote:> dovecot: imap(michael): Error: > fstat(/home/dovecot/michael/.test/dovecot-acl.lock) failed: No such file > or directoryThis is some weird filesystem? fstat() isn't supposed to ever fail with ENOENT.> Another thing that irritates me is that dovecot seems to use the dotlock > locking method, although I explicitly set lock_method to > fcntl (also tried flock, same behavior).The lock_method setting only affects index files. There are several others that always use dotlocks, because they're rarely enough modified that the dotlock performance doesn't matter. That's also why I haven't bothered to set use_excl_lock for them.