[Dovecot] Behavior difference in mbox versus Maildir listing
Hi,
My MUA (claws-mail) is having a hard time listing directories for a mail account with two namespaces, one of which using mbox and the other one using maildir to store mails.
Let's call the namespaces "#mbox." and "#maildir." and have "." as separator.
Assume I have the following folder hierarchy: $namespace $namespace folder $namespace folder folder1a $namespace folder folder1b $namespace folder folder1c
The resulting IMAPv4 session is: mb1 LIST "" "#mbox.%"
- LIST (\Noselect \HasChildren) "." "#mbox.folder" mb1 OK List completed. mb2 LIST "" "#mbox.folder.%"
- LIST (\Noselect \HasChildren) "." "#mbox.folder."
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1a"
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1b"
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1c" mb2 OK List completed. md1 LIST "" "#maildir.%"
- LIST (\HasChildren) "." "#maildir.folder" md1 OK List completed. md2 LIST "" "#maildir.folder.%"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1a"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1b"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1c" md2 OK List completed.
Notice the extra presence of listed folder itself with trailing "." in mb2 that has no equivalent in md2!
Is this expected listing behavior? If so, why the differing behavior between both storage engines?
Affected dovecot versions: at least 1.1.16 and 2.0.11 (installed from Gentoo packages) System is x86 on XFS
Thanks, Bruno
On 21.5.2011, at 23.16, Bruno Prémont wrote:
The resulting IMAPv4 session is: mb1 LIST "" "#mbox.%"
- LIST (\Noselect \HasChildren) "." "#mbox.folder" mb1 OK List completed. mb2 LIST "" "#mbox.folder.%"
- LIST (\Noselect \HasChildren) "." "#mbox.folder."
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1a"
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1b"
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1c" mb2 OK List completed. md1 LIST "" "#maildir.%"
- LIST (\HasChildren) "." "#maildir.folder" md1 OK List completed. md2 LIST "" "#maildir.folder.%"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1a"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1b"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1c" md2 OK List completed.
Notice the extra presence of listed folder itself with trailing "." in mb2 that has no equivalent in md2!
Is this expected listing behavior? If so, why the differing behavior between both storage engines?
It's expected, although maybe not the best behavior. I'm basically copying UW-IMAP behavior for mbox and Courier/Cyrus behavior for Maildir. There are more detailed reasons for why the "#mbox.folder." should be listed, which are described by Mark Crispin somewhere in imap-protocol mailing list archives I think. I've been thinking about making dbox and Maildir (and maybe mbox) behavior identical though..
On Sat, 21 May 2011 Timo Sirainen tss@iki.fi wrote:
On 21.5.2011, at 23.16, Bruno Prémont wrote:
The resulting IMAPv4 session is: mb1 LIST "" "#mbox.%"
- LIST (\Noselect \HasChildren) "." "#mbox.folder" mb1 OK List completed. mb2 LIST "" "#mbox.folder.%"
- LIST (\Noselect \HasChildren) "." "#mbox.folder."
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1a"
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1b"
- LIST (\NoInferiors \UnMarked) "." "#mbox.folder.folder1c" mb2 OK List completed. md1 LIST "" "#maildir.%"
- LIST (\HasChildren) "." "#maildir.folder" md1 OK List completed. md2 LIST "" "#maildir.folder.%"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1a"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1b"
- LIST (\HasNoChildren) "." "#maildir.folder.folder1c" md2 OK List completed.
Notice the extra presence of listed folder itself with trailing "." in mb2 that has no equivalent in md2!
Is this expected listing behavior? If so, why the differing behavior between both storage engines?
It's expected, although maybe not the best behavior. I'm basically copying UW-IMAP behavior for mbox and Courier/Cyrus behavior for Maildir. There are more detailed reasons for why the "#mbox.folder." should be listed, which are described by Mark Crispin somewhere in imap-protocol mailing list archives I think. I've been thinking about making dbox and Maildir (and maybe mbox) behavior identical though..
Hm, at least claws-mail (it uses libetpan) does not survive listing the #mbox namespace here, it loops listing the same folder until it crashes.
The mbox behavior must have changed during 1.1.* series as some time ago I could refresh the folder list (unless claws-mail/libetpan changed their approach of listing folders recently)
Reporting bug over there as crashing/infinite-looping MUA is bad.
If you have a pointer to the detailed reasons for the differing behavior I would appreciate so I could add it to the bug report.
Thanks, Bruno
On 21.5.2011, at 23.35, Bruno Prémont wrote:
It's expected, although maybe not the best behavior. I'm basically copying UW-IMAP behavior for mbox and Courier/Cyrus behavior for Maildir. There are more detailed reasons for why the "#mbox.folder." should be listed, which are described by Mark Crispin somewhere in imap-protocol mailing list archives I think. I've been thinking about making dbox and Maildir (and maybe mbox) behavior identical though..
Hm, at least claws-mail (it uses libetpan) does not survive listing the #mbox namespace here, it loops listing the same folder until it crashes.
Well, then I'd think it always crashes when listing mailboxes with UW-IMAP? If not, it has some special UW-IMAP specific crash-avoidance code..
If you have a pointer to the detailed reasons for the differing behavior I would appreciate so I could add it to the bug report.
Well, one such link is http://marc.info/?l=imap&m=104561252904979&w=2 but there are probably better.
On Sat, 21 May 2011 Timo Sirainen tss@iki.fi wrote:
On 21.5.2011, at 23.35, Bruno Prémont wrote:
It's expected, although maybe not the best behavior. I'm basically copying UW-IMAP behavior for mbox and Courier/Cyrus behavior for Maildir. There are more detailed reasons for why the "#mbox.folder." should be listed, which are described by Mark Crispin somewhere in imap-protocol mailing list archives I think. I've been thinking about making dbox and Maildir (and maybe mbox) behavior identical though..
Hm, at least claws-mail (it uses libetpan) does not survive listing the #mbox namespace here, it loops listing the same folder until it crashes.
Well, then I'd think it always crashes when listing mailboxes with UW-IMAP? If not, it has some special UW-IMAP specific crash-avoidance code..
Don't know if it has heuristics (grepping whole source e.g. for UW-IMAP yields not hit) but it proceeds as one would expect when separator is '/' instead of '.'... (going to check with another separator char just to see!)
If you have a pointer to the detailed reasons for the differing behavior I would appreciate so I could add it to the bug report.
Well, one such link is http://marc.info/?l=imap&m=104561252904979&w=2 but there are probably better.
Ok, so this would mean that the Maildir storage should also list the parent folder as is done for mbox? If other MTAs show trouble it might be worth having a config flag in dovecot tell if parent folder should be listed or not (for all engines)...
Bruno
participants (2)
-
Bruno Prémont
-
Timo Sirainen