GNOME Bugzilla – Bug 757166
Clean up IMAP hierarchy delimiter handling
Last modified: 2016-08-08 14:44:58 UTC
On IMAP servers that default to something other than a '/' as the IMAP hierarchy delimiter (such as Cyrus), Geary's use of '/' as a default that gets updated later causes a lot of bugs, especially in the presence of an unreliable network and working offline. This can be reasonably easily solved (patches to follow) by simply removing the assumption. The main amount of work is in removing FolderRoot.default_separator, but most of the uses of FolderRoot use a null default_separator anyway. Then, by ensuring that an (X)LIST is done up front by ImapAccount so that it knows what the hierarchy delim should be, nearly all of the rest of the cases are taken care. The only two places where we don't know the server's delimiter is in FolderPath.to_string() and in ImapDB.Folder.fetch_status_data(), but these cases don't matter since they never get passed to the server. The final bit of work is in making MailboxSpecifier.from_folder_path require the delim param be non-null, which ensures nowhere else can make the original assumption.
Created attachment 314178 [details] [review] Add hierarchy_delimiter to IMAP account, set it when claiming a session.
Created attachment 314179 [details] [review] Remove Geary.FolderRoot.default_separator
Created attachment 314180 [details] [review] Make MailboxSpecifier.from_folder_path delim parameter required
Created attachment 314181 [details] [review] Switch FolderPath and ImapDB.Folder's placeholder hierarchy delimiter
Adam: I've been running this series of patches against both a Cyrus and (I think) Dovecot for a while now with little issue, it's the last of the engine issues that made Geary difficult to use day-to-day on unreliable networks against Cyrus that I know of. Probably good to commit.
OK - I've pushed all of these to master! Closing this bug.
*** Bug 751756 has been marked as a duplicate of this bug. ***