Synchronize all subscribed mailboxes in the frontend
Steps to reproduce
- Use Nextcloud mail with Zimbra as IMAP server
- Use sub-folders and some filtering rules that automatically put messages in certain folders
- Open the Nextcloud mail client
- Enable
SubscribesandSync in backgroundfor the folder - 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.
Thanks for the report
From my debugging it seems that the front-end only sends a request to
/apps/mail/api/mailboxes/xx/syncfor theINBOXand 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.
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.
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.