[Dovecot] shared mailboxes using namespaces in 1.2
Hi!
I've been using shared mailbox trees using maildir, unix permissions and separate namespaces per shared tree since dovecot 1.0.
However now that I've upgraded to 1.2.8, I cannot create subfolders anymore. The server responds with "NO Invalid mailbox name: test/testsub". The hierarchy separator for the namespaces is / because I am mixing maildir and mbox namespaces and list=yes.
The details: I am using a post-login script (attached) that detects all subfolders of /var/spool/mail/Shared for which the current user has at least read access. For every subfolder, it creates a separate namespace with the prefix Shared/<mailboxname>. The shared mailbox trees are in maildir format.
If one of those namespace-prefixes is e.g. "Shared/sharedmailbox/", I am able to create "Shared/sharedmailbox/test" but trying to create "Shared/sharedmailbox/test/testsub" will fail with the above error. If I set the herarchy separator to '.' even creating "Shared/sharedmailbox/test" will fail.
Any hints?
Thanks, --leo
e-mail ::: Leo.Bergolth (at) wu.ac.at fax ::: +43-1-31336-906050 location ::: IT-Services | Vienna University of Economics | Austria
# 1.2.8: /etc/dovecot.conf # OS: Linux 2.6.27.12-170.2.5.fc10.i686.PAE i686 Fedora release 10 (Cambridge) login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login first_valid_uid: 100 mail_location: mbox:~/mail:INBOX=/var/mail/%u mail_drop_priv_before_exec(default): yes mail_drop_priv_before_exec(imap): yes mail_drop_priv_before_exec(pop3): no mail_executable(default): /usr/local/sbin/dovecot-post-login.pl /usr/libexec/dovecot/imap mail_executable(imap): /usr/local/sbin/dovecot-post-login.pl /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/lib/dovecot/imap mail_plugin_dir(imap): /usr/lib/dovecot/imap mail_plugin_dir(pop3): /usr/lib/dovecot/pop3 namespace: type: private separator: / location: mbox:~/mail:INBOX=/var/mail/%u inbox: yes list: yes subscriptions: yes lda: postmaster_address: postmaster@strike.wu-wien.ac.at auth default: mechanisms: plain gssapi passdb: driver: pam userdb: driver: passwd socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: postfix
On Mon, 2009-11-23 at 17:03 +0100, Alexander 'Leo' Bergolth wrote:
However now that I've upgraded to 1.2.8, I cannot create subfolders anymore. The server responds with "NO Invalid mailbox name: test/testsub". The hierarchy separator for the namespaces is / because I am mixing maildir and mbox namespaces and list=yes.
The details: I am using a post-login script (attached) that detects all subfolders of /var/spool/mail/Shared for which the current user has at least read access. For every subfolder, it creates a separate namespace with the prefix Shared/<mailboxname>. The shared mailbox trees are in maildir format.
Are you setting the hierarchy separator in environment for the other created namespaces? It sounds like you aren't. Looking at logs with mail_debug=yes would verify.
On 11/23/2009 06:28 PM, Timo Sirainen wrote:
On Mon, 2009-11-23 at 17:03 +0100, Alexander 'Leo' Bergolth wrote:
However now that I've upgraded to 1.2.8, I cannot create subfolders anymore. The server responds with "NO Invalid mailbox name: test/testsub". The hierarchy separator for the namespaces is / because I am mixing maildir and mbox namespaces and list=yes.
The details: I am using a post-login script (attached) that detects all subfolders of /var/spool/mail/Shared for which the current user has at least read access. For every subfolder, it creates a separate namespace with the prefix Shared/<mailboxname>. The shared mailbox trees are in maildir format.
Are you setting the hierarchy separator in environment for the other created namespaces? It sounds like you aren't. Looking at logs with mail_debug=yes would verify.
Yes, I am. I am using $ENV{"NAMESPACE_${nr}_SEP"}= "/"; ... in the post-login script.
The debug log says: -------------------- 8< -------------------- Nov 23 19:10:15 strike dovecot: IMAP(leo): Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes Nov 23 19:10:15 strike dovecot: IMAP(leo): mbox: data=~/mail:INBOX=/var/mail/leo Nov 23 19:10:15 strike dovecot: IMAP(leo): fs: root=/home/leo/mail, index=, control=, inbox=/var/mail/leo Nov 23 19:10:15 strike dovecot: IMAP(leo): Namespace: type=shared, prefix=Shared/spamrep/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no Nov 23 19:10:15 strike dovecot: IMAP(leo): maildir: data=/var/spool/mail/Shared/spamrep:CONTROL=~/Maildir/control/Shared/spamrep:INDEX=~/Maildir/index/Share d/spamrep Nov 23 19:10:15 strike dovecot: IMAP(leo): maildir++: root=/var/spool/mail/Shared/spamrep, index=/home/leo/Maildir/index/Shared/spamrep, control=/home/leo/Maildir/control/Shared/spamrep, inbox= -------------------- 8< --------------------
Trying to create Shared/spamrep/test/testsub fails for example...
Cheers, --leo
e-mail ::: Leo.Bergolth (at) wu.ac.at
fax ::: +43-1-31336-906050
location ::: IT-Services | Vienna University of Economics | Austria
On Mon, 2009-11-23 at 19:19 +0100, Alexander 'Leo' Bergolth wrote:
Nov 23 19:10:15 strike dovecot: IMAP(leo): Namespace: type=shared, prefix=Shared/spamrep/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no
See if using type=public works better. type=shared namespace is kind of a special case used to access other users' mailboxes.
On 11/23/2009 07:27 PM, Timo Sirainen wrote:
On Mon, 2009-11-23 at 19:19 +0100, Alexander 'Leo' Bergolth wrote:
Nov 23 19:10:15 strike dovecot: IMAP(leo): Namespace: type=shared, prefix=Shared/spamrep/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no
See if using type=public works better. type=shared namespace is kind of a special case used to access other users' mailboxes.
Yes, thanks! type=public works fine.
Another problem is that with dovecot 1.2, Thunderbird shows "Shared" (the folder that contains all of my dynamically added namespaces) as a real folder, not grey and italic as before. When selecting it, the following message pops up: "The current command did not succeed. The mail server responded: [NONEXISTENT] Mailbox doesn't exist: Shared."
Before the dovecot update, Thunderbird didn't show Shared as a real folder, it was greyed out and selecting it didn't cause an IMAP "SELECT" command.
Looking at the imap traffic, thunderbird does a
16 list "" "%"
... and dovecot returns "Shared" without \Noselect:
- LIST (\HasChildren) "/" "Shared"
Is there a way to tell dovecot that this is only the base of my namespaces and that it should include a \Noselect attribute?
Thanks, --leo
e-mail ::: Leo.Bergolth (at) wu.ac.at fax ::: +43-1-31336-906050 location ::: IT-Services | Vienna University of Economics | Austria
On Mon, 2009-11-23 at 21:39 +0100, Alexander 'Leo' Bergolth wrote:
16 list "" "%"
... and dovecot returns "Shared" without \Noselect:
- LIST (\HasChildren) "/" "Shared"
Is there a way to tell dovecot that this is only the base of my namespaces and that it should include a \Noselect attribute?
In my tests it shows \Noselect.. So something's different with you. What does it show if you do 1 LIST "" "Shared*"? Also do you have a /var/spool/mail/Shared/spamrep/cur/ directory?
On 11/23/2009 09:51 PM, Timo Sirainen wrote:
On Mon, 2009-11-23 at 21:39 +0100, Alexander 'Leo' Bergolth wrote:
16 list "" "%"
... and dovecot returns "Shared" without \Noselect:
- LIST (\HasChildren) "/" "Shared"
Is there a way to tell dovecot that this is only the base of my namespaces and that it should include a \Noselect attribute?
In my tests it shows \Noselect.. So something's different with you. What does it show if you do 1 LIST "" "Shared*"?
-------------------- 8< -------------------- 1 LIST "" "Shared*"
- LIST (\HasChildren) "/" "Shared/spamrep"
- LIST (\HasNoChildren) "/" "Shared/spamrep/INBOX"
- LIST (\HasNoChildren) "/" "Shared/spamrep/ham"
- LIST (\HasNoChildren) "/" "Shared/spamrep/spam-netreport"
- LIST (\HasNoChildren) "/" "Shared/spamrep/spam"
- LIST (\HasNoChildren) "/" "Shared/spamrep/tmp" -------------------- 8< --------------------
LIST "" "*" shows: -------------------- 8< -------------------- [...]
- LIST (\NoInferiors \Marked) "/" "INBOX"
- LIST (\HasChildren) "/" "Shared/spamrep"
- LIST (\HasNoChildren) "/" "Shared/spamrep/INBOX"
- LIST (\HasNoChildren) "/" "Shared/spamrep/ham" [...] -------------------- 8< --------------------
(without Shared/)
... but LIST "" "%" shows: -------------------- 8< -------------------- [...]
- LIST (\NoInferiors \Marked) "/" "INBOX"
- LIST (\HasChildren) "/" "Shared" 1 OK List completed. -------------------- 8< --------------------
Also do you have a /var/spool/mail/Shared/spamrep/cur/ directory?
Yes: # ls -ld /var/spool/mail/Shared/spamrep/cur drwxrws--- 2 nobody spamrep 6 2009-11-23 16:02 /var/spool/mail/Shared/spamrep/cur
I am using dovecot 1.2.8: # rpm -q dovecot dovecot-1.2.8-0_103.fc10.i386 (From ATrpms: http://atrpms.net/dist/f10/dovecot/ )
I have attached the environment captured at the end of the post-login script.
Thanks, --leo
e-mail ::: Leo.Bergolth (at) wu.ac.at fax ::: +43-1-31336-906050 location ::: IT-Services | Vienna University of Economics | Austria
On Mon, 2009-11-23 at 22:56 +0100, Alexander 'Leo' Bergolth wrote:
Also do you have a /var/spool/mail/Shared/spamrep/cur/ directory?
Yes: # ls -ld /var/spool/mail/Shared/spamrep/cur drwxrws--- 2 nobody spamrep 6 2009-11-23 16:02 /var/spool/mail/Shared/spamrep/cur
That's the reason this happens. Anything inside it? Probably not? Just rmdir it and new/ and tmp/.
On 11/23/2009 11:05 PM, Timo Sirainen wrote:
On Mon, 2009-11-23 at 22:56 +0100, Alexander 'Leo' Bergolth wrote:
Also do you have a /var/spool/mail/Shared/spamrep/cur/ directory? Yes: # ls -ld /var/spool/mail/Shared/spamrep/cur drwxrws--- 2 nobody spamrep 6 2009-11-23 16:02 /var/spool/mail/Shared/spamrep/cur
That's the reason this happens. Anything inside it? Probably not? Just rmdir it and new/ and tmp/.
That did it. Many thanks!
--leo
e-mail ::: Leo.Bergolth (at) wu.ac.at fax ::: +43-1-31336-906050 location ::: IT-Services | Vienna University of Economics | Austria
On 11/23/2009 11:05 PM, Timo Sirainen wrote:
On Mon, 2009-11-23 at 22:56 +0100, Alexander 'Leo' Bergolth wrote:
Also do you have a /var/spool/mail/Shared/spamrep/cur/ directory? Yes: # ls -ld /var/spool/mail/Shared/spamrep/cur drwxrws--- 2 nobody spamrep 6 2009-11-23 16:02 /var/spool/mail/Shared/spamrep/cur
That's the reason this happens. Anything inside it? Probably not? Just rmdir it and new/ and tmp/.
Now that I removed the cur folder from Shared/spamrep, everything works fine. But could you shed some light on this?
If Shared/spamrep/ contains cur/, new/ and tmp/, I'd suspect that dovecot should display Shared/spamrep as a folder but not Shared. Why is Shared/ also missing the \Noselect attribute?
Cheers, --leo
e-mail ::: Leo.Bergolth (at) wu.ac.at fax ::: +43-1-31336-906050 location ::: IT-Services | Vienna University of Economics | Austria
On Tue, 2009-11-24 at 00:22 +0100, Alexander 'Leo' Bergolth wrote:
If Shared/spamrep/ contains cur/, new/ and tmp/, I'd suspect that dovecot should display Shared/spamrep as a folder but not Shared. Why is Shared/ also missing the \Noselect attribute?
I suppose it's a bug. Two-level namespace prefixes haven't been tested much. I'll see about getting it fixed.
participants (2)
-
Alexander 'Leo' Bergolth
-
Timo Sirainen