Archiving email locally does not archive it remotely

Description

Hi there! Thanks for creating this awesome software :slight_smile:

I have an problem where I archive email within the Mailspring client, and it appears to be archived on the Mailspring interface. But when I check the webmail directly on my remote server, it has not been archived.

If I then to go “Edit → Preferences → Accounts → Rebuild cache”, the email reappears in Mailspring.

I checked the developer logs, and I see the following

401184 [2024-02-14 13:53:26.314] [main] [info] [local-59991845-2cc7] Running ChangeFolderTask performLocal:
401184 [2024-02-14 13:53:26.341] [main] [info] [local-59991845-2cc7] -- Succeeded. Changing status to `remote`
401184 [2024-02-14 13:53:26.364] [background] [info] syncFolderChangesViaCondstore - Drafts: modseq 9592 to 9592, uidnext 1654 to 1654
401184 [2024-02-14 13:53:26.367] [background] [info] syncFolderUIDRange for Archive, UIDs: 4084 - 9084, Heavy: false
401184 [2024-02-14 13:53:26.448] [background] [info] - Archive: remote=4904, local=1, remoteUID=2qD8u8DxGoYe9UoPXmMkGEiUbbzLDgoDWpYHHDRQr
401184 [2024-02-14 13:53:26.452] [background] [info] - Fetching full headers for 1024 (of 4903 needed)
401184 [2024-02-14 13:53:26.645] [foreground] [info] Idle exited with code 0
401184 [2024-02-14 13:53:26.645] [foreground] [info] [local-59991845-2cc7] Running ChangeFolderTask performRemote:
401184 [2024-02-14 13:53:26.658] [foreground] [error] [local-59991845-2cc7] -- Failed ({"debuginfo":"moveMessages(copy)","key":"ErrorCopy","retryable":false,"what":"std::exception"}). Changing status to `complete`
401184 [2024-02-14 13:53:26.661] [foreground] [info] syncFolderChangesViaCondstore - INBOX: modseq 104881 to 104881, uidnext 14924 to 14924
401184 [2024-02-14 13:53:26.663] [foreground] [info] Idling on folder INBOX

I can see that performRemote is failing, but unfortunately I can’t tell what’s happening with just a report of std::exception. On the mail server, I don’t see any messages.

To Reproduce…

I don’t believe it will be easy to reproduce this issue… I’m not doing anything particularly fancy here. Maybe the one useful detail is that the message I am trying to archive on Mailspring has 26 emails threaded together, while on the web server, it’s just one email (the latest one in the thread), as all others were previously archived.

Expected Behavior

I expect that local changes (e.g., archiving mail) are reflected on the remote server.

Setup

My client side OS: Ubuntu 22.04 Jammy
Mailspring Version: 1.13.3 (via snap)

Mail server OS: Sun Solaris 10
Dovecot Version: 2.0.13

That’s a strange one. I don’t have any ideas right away and I’m not personally familiar with the Solaris mail server. However, Solaris Mail should have some way to increase the logging level so you can see info/debug types of messages. If that was enabled, you should at least see the Mailspring connection activity that is causing the exception. Is that possible?

Also, for further troubleshooting, you could “Toggle Developer Tools” from the Developer menu. This should open up a debug panel on your right side. At the top of the debug panel you should see a button to open the Console (button is usually a little left of the Settings cog icon). See what error output is displayed when you attempt to archive a message. Maybe you can expend it out and get more error information.

Thanks! I’ll talk to our IT admin to see if we can increase the logging level for the mail server, and take a look at the console as well. Will respond here with new info once I have it.

Ok @fcgreg – so we increased the mail log level on the server, and I didn’t see anything interesting (we’re using an older version of dovecot, apparently the logging has improved a lot since that version…)

But I also looked at the console as you suggested, and saw something of interest. Mailspring shows me this email in the “Inbox” folder for all accounts. But when I archive the mail (which I suppose creates a ChangeFolderTask), it seems mailspring internally thinks the email is in the “Sent” folder and is trying to move it to the “Archive” folder.

Perhaps that’s the source of the issue? The message is definitely in the inbox on the mail server, mailspring also shows it as being in my inbox in the GUI, but the ChangeFolderTask has the “previousFolder” set to “Sent”.

This is a multi-message threaded email chain, so some of these would probably be classified as “sent” on the mail server, while some would be “archive”, and the latest message would be “inbox.” Maybe that’s somehow confusing mailspring? (I know next to nothing about how mail servers work, so not sure how it internally represents such threaded email chains – apologies…).

See images for console (there are two images because the “origin” was too large to display with everything else when expanded. I assume that isn’t so useful here, but posting just in case…)