mail icon indicating copy to clipboard operation
mail copied to clipboard

Synchronize all subscribed mailboxes in the frontend

Open LEDfan opened this issue 7 months ago • 3 comments

Steps to reproduce

  1. Use Nextcloud mail with Zimbra as IMAP server
  2. Use sub-folders and some filtering rules that automatically put messages in certain folders
  3. Open the Nextcloud mail client
  4. Enable Subscribes and Sync in background for the folder
  5. Receive a message in a sub-folder

Expected behavior

The mail client loads the new email and shows that there is an unread email.

Actual behavior

The new e-mail isn't loaded and the user is unaware of the new message in the sub-folder.

Mail app version

5.1.2

Nextcloud version

30.0.11

Mailserver or service

Zimbra

Operating system

Docker image on Kubernetes

PHP engine version

PHP 8.2

Nextcloud memory caching

config.php:  'memcache.local' => '\\OC\\Memcache\\APCu'
config.php:  'memcache.distributed' => '\\OC\\Memcache\\Redis'
config.php:  'memcache.locking' => '\\OC\\Memcache\\Redis'

Web server

Apache (supported)

Database

PostgreSQL

Additional info

From my debugging it seems that the front-end only sends a request to /apps/mail/api/mailboxes/xx/sync for the INBOX and the currently opened sub-folder. I guess that if you send this request for every sub-folder, the issue would be solved.

LEDfan avatar Jun 05 '25 08:06 LEDfan

Thanks for the report

From my debugging it seems that the front-end only sends a request to /apps/mail/api/mailboxes/xx/sync for the INBOX and the currently opened sub-folder. I guess that if you send this request for every sub-folder, the issue would be solved.

That is correct. With background synchronization we mean synchronization in the cron jobs. The frontend doesn't keep all mailboxes in sync.

ChristophWurst avatar Jun 17 '25 12:06 ChristophWurst

Thanks for the confirmation! Do you think sending the sync request for every subfolder is a good approach? Should it be configurable? I (or one of my colleagues) could try to implement this.

LEDfan avatar Jun 17 '25 15:06 LEDfan

I think it depends 😉

If you have 10 subscribed mailboxes it will be fine. But I have also seen people with 200-300 mailboxes, because they have very specific organization, then one sync request per mailbox is going to keep the server busy for a long time, and the many IMAP connections can trigger rate limiting.

Perhaps it would be best if we had a combined endpoint to sync mailboxes of an account in bulk. Then there is only one IMAP connection, at least.

ChristophWurst avatar Jun 18 '25 07:06 ChristophWurst