[Dovecot] Shared folders and subscriptions
Hi,
I've got a problem with user shared folders and subscriptions. When I try to subscribe a folder, dovecot returns "OK Subscribe completed", but the newly subscribed folder is not listed with LSUB:
a1 login test@example.com ******* a1 OK [CAP..... a2 list "" "*"
- LIST (\HasChildren) "/" "INBOX"
- LIST (\Noselect \HasChildren) "/" "#User"
- LIST (\Noselect \HasChildren) "/" "#User/markus@example.com"
- LIST (\HasNoChildren) "/" "#User/markus@example.com/ForTest" a3 subscribe "#User/markus@example.com/ForTest" a3 OK Subscribe completed. a4 lsub "" "*"
- LSUB (\Noselect) "/" "#User/markus@example.com"
Dovecot is 1.2-rc3, namespace configuration as follows:
namespace private { separator = / prefix = INBOX/ inbox = yes subscriptions = yes }
namespace public { separator = / prefix = "#Shared/" location = maildir:/var/spool/dovecot/sharedfolders:INDEX=~/Maildir/index/public:CONTROL=~/Maildir/control/public subscriptions = yes }
namespace shared { separator = / prefix = "#User/%%u/" location = maildir:%%h/Maildir:INDEX=~/Maildir/index/shared/%%u:CONTROL=~/Maildir/control/shared subscriptions = yes list = yes }
I tried without CONTROL= directory in the shared namespace, but that made no difference.
Contents of the subscriptions (with CONTROL=) file after subscribing:
ForTestUser
Regards, Markus
On Fri, 2009-04-17 at 22:48 +0200, Markus Werner wrote:
namespace shared { separator = / prefix = "#User/%%u/" location = maildir:%%h/Maildir:INDEX=~/Maildir/index/shared/%%u:CONTROL=~/Maildir/control/shared subscriptions = yes list = yes }
The CONTROL must have also %%u in it, otherwise different shared users' control files get mixed together and everything breaks.
Preferably you should also be using subscriptions=no so you wouldn't have to specify CONTROL at all, but for that you'd need to have a namespace with prefix="".
Anyway, this fixes subscriptions=yes: http://hg.dovecot.org/dovecot-1.2/rev/0dcb7e34a216
On Fri, Apr 17, 2009 at 05:22:32PM -0400, Timo Sirainen wrote:
On Fri, 2009-04-17 at 22:48 +0200, Markus Werner wrote:
namespace shared { separator = / prefix = "#User/%%u/" location = maildir:%%h/Maildir:INDEX=~/Maildir/index/shared/%%u:CONTROL=~/Maildir/control/shared subscriptions = yes list = yes }
The CONTROL must have also %%u in it, otherwise different shared users' control files get mixed together and everything breaks.
Thanks. I completely overlooked that missing part.
Preferably you should also be using subscriptions=no so you wouldn't have to specify CONTROL at all, but for that you'd need to have a namespace with prefix="".
Would an additional namespace, for subscriptions only, work? I would like to keep all subfolders of an Mailbox under INBOX/ .
Anyway, this fixes subscriptions=yes: http://hg.dovecot.org/dovecot-1.2/rev/0dcb7e34a216
Works, thanks.
On Fri, 2009-04-17 at 23:38 +0200, Markus Werner wrote:
Preferably you should also be using subscriptions=no so you wouldn't have to specify CONTROL at all, but for that you'd need to have a namespace with prefix="".
Would an additional namespace, for subscriptions only, work? I would like to keep all subfolders of an Mailbox under INBOX/ .
It would be possible to do both. The INBOX/ could be set up as a hidden namespace and the "" namespace would be the default one. Or is there a reason why you wouldn't want "" namespace to show up anything?
Or you could also see if you could create a private namespace with prefix="#User/" and subscriptions=yes, perhaps with location=maildir:/var/lib/dovecot/empty:CONTROL=~/Maildir/shared where the empty directory would be a world-readable non-writable empty directory. That namespace should then catch subscriptions to shared mailboxes.
On Fri, Apr 17, 2009 at 05:43:01PM -0400, Timo Sirainen wrote:
It would be possible to do both. The INBOX/ could be set up as a hidden namespace and the "" namespace would be the default one. Or is there a reason why you wouldn't want "" namespace to show up anything?
Crying users, because suddenly something in their clients looks "very" different :) I have many of those.
Or you could also see if you could create a private namespace with prefix="#User/" and subscriptions=yes, perhaps with location=maildir:/var/lib/dovecot/empty:CONTROL=~/Maildir/shared where the empty directory would be a world-readable non-writable empty directory. That namespace should then catch subscriptions to shared mailboxes.
I tried this. The following is logged:
Apr 18 00:12:01 asterix dovecot: IMAP(markus@example.com): fchown(/var/spool/dovecot/users/example.com/markus/Maildir/control/shared/subscriptions.lock, -1, 0) failed: Operation not permitted Apr 18 00:12:01 asterix dovecot: IMAP(markus@example.com): file_dotlock_open() failed with subscription file /var/spool/dovecot/users/example.com/markus/Maildir/control/shared/subscriptions: Operation not permitted
On Apr 17, 2009, at 6:28 PM, Markus Werner wrote:
Or you could also see if you could create a private namespace with prefix="#User/" and subscriptions=yes, perhaps with location=maildir:/var/lib/dovecot/empty:CONTROL=~/Maildir/shared
where the empty directory would be a world-readable non-writable empty directory. That namespace should then catch subscriptions to shared mailboxes.I tried this. The following is logged:
Apr 18 00:12:01 asterix dovecot: IMAP(markus@example.com): fchown(/var/spool/dovecot/users/example.com/markus/Maildir/control/ shared/subscriptions.lock, -1, 0) failed: Operation not permitted
It tries to preserve the group. Try chmod g+s to the empty directory.
On Fri, Apr 17, 2009 at 07:07:49PM -0400, Timo Sirainen wrote:
I tried this. The following is logged:
Apr 18 00:12:01 asterix dovecot: IMAP(markus@example.com): fchown(/var/spool/dovecot/users/example.com/markus/Maildir/control/ shared/subscriptions.lock, -1, 0) failed: Operation not permitted
It tries to preserve the group. Try chmod g+s to the empty directory.
That worked. Thanks again.
participants (2)
-
Markus Werner
-
Timo Sirainen