Stalwart mail: System folders are duplicated
Steps to reproduce
- Set up a Stalwart mail server
- Login to it through Nextcloud Mail
- Enjoy the chaos 🙃
Expected behavior
- One Drafts folder
- One Sent folder
- One Spam folder
- One Trash folder
- All the shared folders stuff in Shared folders
Actual behavior
Mail app version
5.1.0
Nextcloud version
31.0.2
Mailserver or service
Stalwart Mail
Operating system
Debian 12 Bookworm (official Nextcloud container)
PHP engine version
PHP 8.3
Nextcloud memory caching
No response
Web server
Apache (supported)
Database
PostgreSQL
Additional info
Note that I am dealing with accounts storing tens of Gio of data, on a replicated FoundationDB backend.
Moreover, please note that among all these duplicated folders, only 1 or 2 of each are pointing to a working inbox, all the others are returning {"details":"Mailbox does not exist.","logged":false,"raw_msg":"IMAP error reported by server."},"CustomMessage":"IMAP error reported by server."} in the log
Finally, syncing these mailboxes without the --sync parameter (occ mail:account:sync -vvv <accountID>) always fails with:
In ImapToDbSynchronizer.php line 282:
[OCA\Mail\Exception\ServiceException]
Sync failed for 8:<Random mailbox>: Could not open mailbox "<Random mailbox>".
Where <Random mailbox> is changing each time I run the command (and it includes the INBOX folder 🤦)
@DodoLeDev what version or SW are you using? I have it installed so I can test this issue.
Thank you for your report @DodoLeDev
@SebastianKrupinski please do the triage
@DodoLeDev what version or SW are you using? I have it installed so I can test this issue.
I am currently using the 0.11.8 version (migrating to the latest 0.12 is currently not possible because of all the breaking changes it involves)
Ok, I think I found the problem: Nextcloud Mail flattens all the shared folders Stalwart creates when a user belongs to a group.
They should normally be hidden behind the "Shared folder" directory
This problem is still in 0.13.3 and is making shared mailboxes unusable in NextCloud Mail.