Mailbox download worker for our own mailbox

Merged akwizgran requested to merge 2293-own-mailbox-download-worker into master

This branch adds a download worker for our own mailbox. The worker tries to ensure some degree of fairness between contacts as follows:

  • Download from folders in round-robin order, shuffling the folders first so we don't always favour the same contact
  • After every 1,000 downloads, check again for folders with available files so that newly arrived files are included in the round-robin

This worker turned out to be more similar to the existing ContactMailboxDownloadWorker than I was expected, so I refactored the duplicated code into a superclass. Unfortunately the diff doesn't make it very clear, but most of the code in the superclass was just copied from the old ContactMailboxDownloadWorker, replacing MailboxFile with FolderFile to allow for the fact that the two workers get their folder IDs from different places.

Closes #2293 (closed)

Merge request reports