GNOME Bugzilla – Bug 313593
imap4: sub folders not working
Last modified: 2013-09-13 00:51:41 UTC
Please describe the problem: Mailserver: AIX IMAP4rev1 v10.190 server Evolution: 2.3.7 (earlier version were also affected) Backend: IMAP4rev1 When running Evolution with the aforementioned server, subdirectories do not work properly. The IMAP directory structure on the server looks like the following: ~/mail/INBOX ~/mail/Subdirectory1 ~/mail/Subdirectory1/Subdirectory ~/mail/Subdirectory2/Subdirectory [...] We have configured Evolution accordingly in the preferences dialog, both with the "override server-supplied namespace" options disabled or with the same option set to "~", "~/mail" or just "mail". We also tried all of these options with or without a trailing slash. Steps to reproduce: Actual results: Most of the time, only the "Inbox" directory is shown in Evolution. Sometimes when we were changing the configuration in the preferences dialog, the folders would appear temporarily. However, Evolution would expose the Unix directory structure to the user, that is, a "~" and "mail" subdirectory were visible. After restarting Evolution the directory structure disappeared alltogether from Evolution, leaving only the "Inbox" folder visible. We have not found a way to make all subdirectories appear in Evolution consistently. Expected results: Does this happen every time? Yes. Other information: * When running the "IMAP" backend (rather than the "IMAP4rev1" backend mentioned above) the directories appear, but the whole structure is flattened - subdirectories are all exposed to the user as if they were top level directories. * The Microsoft Outlook clients work properly with the same user account on the same server.
Created attachment 50766 [details] CAMEL_VERBOSE_DEBUG=1 evolution 2>evolution.log I have appended the a debugging output. For your reference, I also tried to log into the IMAP server manually issuing a few commands: * PREAUTH spserv18 IMAP4rev1 v10.190 server ready a01 login cip-peer password a01 BAD Command unrecognized: LOGIN a01 list "" "" * LIST () "/" "" a01 OK LIST completed A00003 LIST "" INBOX * LIST (\NoInferiors) NIL INBOX A00003 OK LIST completed a01 list "" "*" * LIST (\NoSelect) "/" mail * LIST (\NoSelect) "/" mail/Allgemein * LIST (\NoInferiors) "/" mail/Allgemein/NTP [...many subdirectories listed...]
lsub "" "~/mail//*" is returning nothing in that log, so thats' all we're showing. that's the problem. Try turning of the 'use namespace' option, or removing the trailing '/'. perhaps, or turning off the 'show only subscribed' option. also attach the imap backend log too, if that has the problems above (perhaps to another bug report).
I double checked: The appended log happened when the 'use namespace' and 'show only subscribed' options are both disabled in the preferences dialog; I can also still reproduce this. The lsub "" "~/mail//*" command is sent anyway. I have not found a way to cause this old configuration to be forgotten.
I am able to override the above mentioned configuration problem by enabling the 'override namspace' option, but clearing the contents of the entry box. So I guess the first problem is that the flag option is considered "checked" regardless of whether it is actually flagged. However, by not using any namespace, the "~" and "mail" subdirectories are exposed to the user. So I tried to fill in "~/mail" (without the trailing slash) as you recommended. However, this does not seem to change the behavior. The subdirectories are still exposed. I will append another log.
Created attachment 50849 [details] Log with namspace set to "~/mail" Note that the namespace is used by the LSUB command. Evolution still displays the "~" and "mail" folders in the GUI.
I think I understand the problem better now. RFC3501 prevents an IMAP server to send a LSUB reply with a namespaced mailbox name. Section 7.2.2 states: "The name represents an unambiguous left-to-right hierarchy, and MUST be valid for use as a reference in LIST and LSUB commands. Unless \Noselect is indicated, the name MUST also be valid as an argument for commands, such as SELECT, that accept mailbox names." Since the reference name in LIST and LSUB commands is a full mailbox name, that means it can not be namespaced in the reply. This means that regardless whether or not a namespace was specified, the returned mailbox name still needs to be processed to have the namespace removed. I haven't found the response parser in Evolution's backend though. (And which one is it, IMAP, IMAP4, IMAPP or IMAPX?) Any hints/idea?
imapp and imapx aren't available in the ui, only imap and imap4rev1. imap is the old code and imap4 is the new (but unfinished/experimental) code. the log provided suggests you are using the imap4 code
Created attachment 50883 [details] [review] fix for imap code This seems to fix it for me for imap, it will show up as a toplevel folder named "~.mail", with the folder tree under that as normal. / is replaced with . - this is an old hangover that needs to stay for config compatability reasons. i couldn't get imap4 to logon to my server since i was using ssh to connect, and pre-auth isn't supported on it, so i haven't tried to fix the problem there.
I have yet to test this patch, but why would the namespace be exposed to client at all? Wouldn't that render the idea of namespaces useless? - Making the namespace the same as a folder removes the administrative advantage of namespacing. Ensuring that a client stores all files of a specific category under one directory/mailbox is no longer possible. - Exposing the namespace causes interoperability problems with other mailclients. Outlook and Mozilla Thunderbird hide the namespace, for example. - In general, the UI would then need to prevent users from creating folders outside of the namespace even if the filesystem permissions allowed it. This behavior is confusing though, because in the GUI a namespace can not be distinguished from a folder. - It is hard to explain to users why this needs to be shown in the GUI - it's a technical detail after all. Users shouldn't have to care about it. Of course, the namespace could also be hidden somewhere outside of camel, but this might be harder to do (not sure).
always worked like this, not going to change it. if you had multiple namespaces, they need to be shown, otherwise the ui can't work.