Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-3655

Quota extensions (mailbox plugins) do not take delegation into account

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.7.0
    • 3.7.0
    • elasticsearch, mailbox
    • None

    Description

      Context

      Me and my team are planning to work on Functional Mailboxes (mailboxes belonging to a team) in our TMail product.

      As such we want to support quotas for such functional mailboxes. In order to do so, we conducted an audit of existing quota pugin in James.

      Mailbox quota plugins includes:

      • Quota search, allow filtering and sorting users by their quota usage, allowing an admin to conduct actions.
      • Over quota mailing emailing users regarding their quota use...

      Bug description

      We found that the user definition in the two mailbox plugins is linked to the user performing the action and not to the actual users the resources belongs to.

      This can cause innacurate reports for users performing actions on mailboxes shared to them.

      I wrote the following test and it was failing- for the distributed version:

      GIVEN two users (BOB CEDRIC) with 0/20 mails quota
      AND CEDRIC delegates his mailbox to BOB
      WHEN BOB adds 19 message to CEDRIC mailbox
      THEN we expect CEDRIC to be reported with a 95% quota ration by quota search
      

      The proposed fix

      We need to be able to, given a quota root, be able to find the user the resource actually belong to.

      The `QuotaRootResolver` sounds like the right place to enclose that knowledge:

      public interface QuotaRootResolver extends QuotaRootDeserializer {
          Username associatedUsername(QuotaRoot quotaRoot) throws MailboxException;
      }
      

      The above mentioned quota root extensions would then rely on it instead of the user performing the action...

      Bonus point: I strongly suspect this would be enough to make these extensions usable in the context of shared mailboxes...

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              btellier Benoit Tellier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m