I've been having problems with Pine 4.62 talking to Dovecot 1.0 stable. It's fine when the folder collection path is empty, but if I have "~/mail/" or "mail/" it gives access errors (I'm using the "~/mail/", "mail/" etc. hidden namespaces for backwards compatability). It seems to me that Dovecot is not replying correctly to a "LIST" command with empty mailbox name: - Dovecot: xyz LIST "" "" * LIST (\NoSelect) "/" "" xyz LIST "~/mail/" "" * LIST (\NoSelect) "/" "" xyz LIST "mail/" "" * LIST (\NoSelect) "/" "" UW-IMAP; xyz LIST "" "" * LIST (\NoSelect) "/" "" xyz LIST "~/mail/" "" * LIST (\NoSelect) "/" ~/ xyz LIST "mail/" "" * LIST (\NoSelect) "/" mail/ RFC 2060 says: An empty ("" string) mailbox name argument is a special request to return the hierarchy delimiter and the root name of the name given in the reference. The value returned as the root MAY be null if the reference is non-rooted or is null. In all cases, the hierarchy delimiter is returned. This permits a client to get the hierarchy delimiter even when no mailboxes by that name currently exist. Mind you, it looks like at least our UW-IMAP also gets it wrong for "~/mail/". Of course, I may be misunderstanding something! Best Wishes, Chris --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-- Christopher Wakelin, c.d.wakelin at reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094
On 18.3.2005, at 19:36, Chris Wakelin wrote:> An empty ("" string) mailbox name argument is a special request to > return the hierarchy delimiter and the root name of the name > given > in the reference. The value returned as the root MAY be null if > the reference is non-rooted or is null. In all cases, the > hierarchy delimiter is returned. This permits a client to get > the > hierarchy delimiter even when no mailboxes by that name currently > exist...> Mind you, it looks like at least our UW-IMAP also gets it wrong for > "~/mail/". Of course, I may be misunderstanding something!No, after reading it through several times and testing how UW-IMAP reacts to different input, I finally understood it. The "root name" means the first part of the hierarchical mailbox name (um. is that any more understandable?). Eg. "foo/bar/baz" -> "foo/". I'll change it to return that. -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20050318/d71270c6/attachment-0001.bin>
On Fri, 18 Mar 2005 19:52:34 +0200 Timo Sirainen <tss at iki.fi> wrote:> On 18.3.2005, at 19:36, Chris Wakelin wrote: > > > An empty ("" string) mailbox name argument is a special request to > > return the hierarchy delimiter and the root name of the name > > given > > in the reference. The value returned as the root MAY be null if > > the reference is non-rooted or is null. In all cases, the > > hierarchy delimiter is returned. This permits a client to get > > the > > hierarchy delimiter even when no mailboxes by that name currently > > exist. > .. > > Mind you, it looks like at least our UW-IMAP also gets it wrong for > > "~/mail/". Of course, I may be misunderstanding something! > > No, after reading it through several times and testing how UW-IMAP > reacts to different input, I finally understood it. The "root name" > means the first part of the hierarchical mailbox name (um. is that any > more understandable?). Eg. "foo/bar/baz" -> "foo/". I'll change it to > return that.Ah! That makes more sense, and in that case UW-IMAP isn't getting it wrong for "~/mail/" after all. I've tried your fix, but it doesn't seem to work. I'm still getting '* LIST (\NoSelect) "/" ""' for all the hidden namespaces. Looking at the code, my guess is that the namespace_find() call is modifying "ref" and so the strchr() never finds a match. This patch --- dovecot-1.0-stable.orig/src/imap/cmd-list.c Fri Mar 18 20:00:44 2005 +++ dovecot-1.0-stable/src/imap/cmd-list.c Mon Mar 21 11:53:26 2005 @@ -366,7 +366,8 @@ concept which probably no other client uses than Pine. Just try our best to emulate UW-IMAP behavior and hopefully we're fine. */ - ns = namespace_find(client->namespaces, &ref); + const char *ref_copy = t_strdup(ref); + ns = namespace_find(client->namespaces, &ref_copy); if (ns == NULL) { const char *empty = ""; ns = namespace_find(client->namespaces, &empty); seems to work, but I'm no expert in C (I program by imitation ;-) ), so I may have made a mistake with pointers, consts, string functions etc. Having said that, Pine is still getting confused. This time it's trying 'LIST "" ~/mail' and getting no results whereas UW-IMAP gives '* LIST (\NoSelect) "/" ~/mail'. Best Wishes, Chris --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-- Christopher Wakelin, c.d.wakelin at reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094