Skip to content
Commit e523a60e authored by Grzegorz Kowal's avatar Grzegorz Kowal Committed by Daniel Vrátil
Browse files

Process IMAP Quota roots with associated quotas only

Summary:
According to IMAP4 QUOTA extension (RFC2087) each mailbox may have zero or more quota roots, and each quota root may have zero or more resource limits (quotas). It means that depending on implementation GETQUOTAROOT command may return some roots with no corresponding QUOTA responses. Such roots simply have no limitations of resource. Moreover, the RFC explains that quota root names do not have to match the names of the existing mailboxes.

This commit tries to make the IMAP Quota roots retrieval more conformant with RFC2087. It processes all quota roots returned by GETQUOTAROOT command and filters out roots with no corresponding QUOTA responses. As previously, it sets newCurrent and newMax variables from the root which matches the mailbox name, however, it uses the first existing QUOTA response otherwise.

This change guarantees that lists newRoots, newLimits, and newUsage always have the same number of elements and that newCurrent and newMax values are retrieved even for mailboxes with multiple roots.

In addition two autotests are added. First one checks if roots with no corresponding resource limits are filtered out correctly. Second one checks if the current and maximum values of quota are set correctly, if among multiple roots, with resources or with no resource, one matches the mailbox name.

Reviewers: #kde_pim, mlaurent, dvratil

Reviewed By: #kde_pim, dvratil

Subscribers: mlaurent, dvratil, kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D14629
parent c9254f34
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment