mail icon indicating copy to clipboard operation
mail copied to clipboard

Stalwart mail: System folders are duplicated

Open DodoLeDev opened this issue 7 months ago • 6 comments

Steps to reproduce

  1. Set up a Stalwart mail server
  2. Login to it through Nextcloud Mail
  3. 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

Image

Image

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.

DodoLeDev avatar May 26 '25 08:05 DodoLeDev

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

DodoLeDev avatar May 26 '25 08:05 DodoLeDev

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 avatar May 26 '25 08:05 DodoLeDev

@DodoLeDev what version or SW are you using? I have it installed so I can test this issue.

SebastianKrupinski avatar May 26 '25 17:05 SebastianKrupinski

Thank you for your report @DodoLeDev

@SebastianKrupinski please do the triage

ChristophWurst avatar May 27 '25 12:05 ChristophWurst

@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)

DodoLeDev avatar Jun 02 '25 10:06 DodoLeDev

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

DodoLeDev avatar Jun 05 '25 13:06 DodoLeDev

This problem is still in 0.13.3 and is making shared mailboxes unusable in NextCloud Mail.

thedejavunl avatar Sep 12 '25 15:09 thedejavunl