Sync should only download subscribed folders (LSUB) #120

Open
opened 2020-03-19 13:21:33 +01:00 by netandreus · 1 comment
netandreus commented 2020-03-19 13:21:33 +01:00 (Migrated from github.com)

Describe the bug
As we discuss in https://github.com/mikegioia/libremail/issues/105 there is a problem with syncing Exchange mailboxes. There are many clients of Microsoft Office365 mail system, and I think it is important. Problem occurs when we sync folders like "Archive" e.t.c.

To Reproduce
Steps to reproduce the behavior:

  1. Add Microsoft Office365 mail account.
  2. Try to sync it
  3. See errors
[19-Mar-20 11:54:04] DEBUG: No messages to delete in Archive
[19-Mar-20 11:54:04] ERROR: cannot read - connection closed?

Also when we try to sync folder "Calendar/United States holidays" in database added this messages:

**Message.subject**
Retrieval using the IMAP4 protocol failed for the following message: 367

**Message.text_plain**
The server couldn't retrieve the following message:

Subject: "Juneteenth"
From: "xxxx" ("/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=D6FFC709A0FE4E2F8AD251C6DE637AAD-ADMIN")
Sent date: 9/21/2019 9:00:25 PM

Expected behavior
Correctly folders sync.

Possible solution
As we decide it should be mechanism to per-account select folders to sync. And this mechanism already exists - it is "folder subscriptions". But it has one disadvantage. Folders "INBOX" and "Outbox" by default are unsubscribed and Outlook client synced it ignoring subscriptions.

unsubscribed_but_displayed

So we need to set mandatory_sync_folders parameter somewhere (for example in default.ini / local.ini).
It also needed parameter sync_only_subscribed_folders, which will be regulate behavior of this functionality. Default sync_only_subscribed_folders = false for current behavior.

Requirements
I have already done some work with required libraries. You just need to review it :)

**Describe the bug** As we discuss in https://github.com/mikegioia/libremail/issues/105 there is a problem with syncing Exchange mailboxes. There are many clients of Microsoft Office365 mail system, and I think it is important. Problem occurs when we sync folders like "Archive" e.t.c. **To Reproduce** Steps to reproduce the behavior: 1. Add Microsoft Office365 mail account. 2. Try to sync it 3. See errors ``` [19-Mar-20 11:54:04] DEBUG: No messages to delete in Archive [19-Mar-20 11:54:04] ERROR: cannot read - connection closed? ``` Also when we try to sync folder "Calendar/United States holidays" in database added this messages: ``` **Message.subject** Retrieval using the IMAP4 protocol failed for the following message: 367 **Message.text_plain** The server couldn't retrieve the following message: Subject: "Juneteenth" From: "xxxx" ("/O=EXCHANGELABS/OU=EXCHANGE ADMINISTRATIVE GROUP (FYDIBOHF23SPDLT)/CN=RECIPIENTS/CN=D6FFC709A0FE4E2F8AD251C6DE637AAD-ADMIN") Sent date: 9/21/2019 9:00:25 PM ``` **Expected behavior** Correctly folders sync. **Possible solution** As we decide it should be mechanism to per-account select folders to sync. And this mechanism already exists - it is "folder subscriptions". But it has one disadvantage. Folders "INBOX" and "Outbox" by default are unsubscribed and Outlook client synced it ignoring subscriptions. ![unsubscribed_but_displayed](https://user-images.githubusercontent.com/313477/77066738-bb16ed00-69f4-11ea-965e-42beda7e08da.png) So we need to set **mandatory_sync_folders** parameter somewhere (for example in default.ini / local.ini). It also needed parameter **sync_only_subscribed_folders**, which will be regulate behavior of this functionality. Default **sync_only_subscribed_folders** = false for current behavior. **Requirements** I have already done some work with required libraries. You just need to review it :) - https://github.com/ParticleBits/zend-mail/pull/5 (to develop branch) - https://github.com/ParticleBits/imap/pull/4 (to master branch)
netandreus commented 2020-03-19 13:28:22 +01:00 (Migrated from github.com)

I finish this work @mikegioia Please review my pull request https://github.com/mikegioia/libremail/pull/121

I finish this work @mikegioia Please review my pull request https://github.com/mikegioia/libremail/pull/121
Sign in to join this conversation.
No description provided.