After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 735200 - [IMAPx] Fails to handle QUOTA response with no quotas
[IMAPx] Fails to handle QUOTA response with no quotas
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
3.10.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2014-08-21 23:08 UTC by Jeffrey Hutzelman
Modified: 2014-09-01 23:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to handle QUOTA responses with an empty resource lists (3.96 KB, patch)
2014-08-21 23:08 UTC, Jeffrey Hutzelman
committed Details | Review

Description Jeffrey Hutzelman 2014-08-21 23:08:31 UTC
Created attachment 284163 [details] [review]
patch to handle QUOTA responses with an empty resource lists

The IMAP QUOTA extension permits the list of resource-usage-limit tuples in an untagged QUOTA response to be empty (see RFC2087 section 5.1, which states "The list contains zero or more triplets".  This happens when the server supports quotas, but no quota is set on a particular mailbox.

Unfortuantely, camel_imapx_parse_quota cannot handle an empty list, and instead reports "expecting atom!", as shown in the debugging output below:

[imapx:A] camel_imapx_write: 'A00061 GETQUOTAROOT INBOX
'
[imapx:A] camel_imapx_read: buffer is 'A00060 OK Completed
'
[imapx:A] camel_imapx_read: buffer is '* QUOTAROOT INBOX user.jhutz
* QUOTA user.jhutz ()
A00061 OK Completed
'
[imapx:A] expecting atom!


The attached patch (for master) fixes the problem, and additionally causes imapx_get_quota_info_sync() to return G_IO_ERROR_NOT_SUPPORTED when a folder has no quotas, which tells the caller the server does not support quotas for this mailbox, rather than G_IO_ERROR_NOT_FOUND, which is perhaps more correct but confuses the upper layers.

I can also provide an equivalent patch for 3.10, which is a little different because 3.10 predates the introduction of CamelIMAPXInputStream.  If 3.10 is no longer being maintained, I'll submit that version directly to the Ubuntu folks.
Comment 1 Milan Crha 2014-09-01 15:59:27 UTC
Thanks for a bug report and patch. It looks fine and my simple tests didn't show any issue, thus I'm committing it to master and stable:

Created commit 4730ee9 in eds master (3.13.6+) [1]
Created commit 6f6ebad in eds evolution-data-server-3-12 (3.12.6+)

[1] https://git.gnome.org/browse/evolution-data-server/commit/?id=4730ee9
Comment 2 Milan Crha 2014-09-01 16:00:45 UTC
I forgot to add, 3.10.x is really out of question, I'm not going to commit anything there. Please, send your patch to respective distribution maintainers for inclusion, if needed.
Comment 3 Jeffrey Hutzelman 2014-09-01 23:55:40 UTC
OK; thanks for the update, and the clarification on 3.10.  That's about what I expected, but I figured I'd offer it here before going downstream.