Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛: Email cannot be deleted after moving it #1201

Open
1 task done
mtomasek780 opened this issue Feb 11, 2025 · 14 comments
Open
1 task done

🐛: Email cannot be deleted after moving it #1201

mtomasek780 opened this issue Feb 11, 2025 · 14 comments
Labels
bug Something isn't working

Comments

@mtomasek780
Copy link

What happened?

A similar issue to bug #1199 , when I moved a group of messages from junk to the inbox, I am unable to delete the messages. I have tried the following steps:

  • Multiple devices (iphone 14, macOS 15.1.1)
  • Moving the messages to a local draft folder, deleting them, then moving back to inbox
  • Rebuilding the inbox in Apple Mail
  • Reindexing the inbox in Apple Mail
  • Downloaded Thunderbird for Linux and tried deleting the messages, but cannot.

How can we reproduce the problem?

I used macOS 15.1.1 and Apple Mail, I simply dragged the messages out of Junk and into the Inbox. There was no error displayed, but when I tried to delete the messages, I received errors.

Version

v0.11.x

What database are you using?

RocksDB

What blob storage are you using?

None

Where is your directory located?

Internal

What operating system are you using?

Docker

Relevant log output

2025-02-07T13:39:47Z DEBUG IMAP IDLE stop (imap.idle-stop) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, elapsed = 22374ms
2025-02-07T13:39:47Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, size = 25, contents = "182.1 OK IDLE completed\r\n"
2025-02-07T13:39:47Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, size = 2, contents = "\r\n"
2025-02-07T13:39:47Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, size = 37, contents = "183.1 UID COPY 2142 "Deleted Items"\r\n"
2025-02-07T13:39:47Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-07T13:39:47Z DEBUG IMAP error occurred (imap.error) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, details = No messages were copied., id = "183.1"
2025-02-07T13:39:47Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, size = 35, contents = "183.1 NO No messages were copied.\r\n"
2025-02-07T13:39:47Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, size = 12, contents = "184.1 IDLE\r\n"
2025-02-07T13:39:47Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, size = 32, contents = "+ Idling, send 'DONE' to stop.\r\n"
2025-02-07T13:39:47Z DEBUG IMAP IDLE start (imap.idle-start) listenerId = "imaptls", localPort = 993, remoteIp = 192.168.1.1, remotePort = 58801, elapsed = 0ms

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mtomasek780 mtomasek780 added the bug Something isn't working label Feb 11, 2025
@mtomasek780
Copy link
Author

DebugFromMacOS_Mail.txt

Log with Debug turned up to 5 on a MacOS system using mail, attempting to delete a message, and it immediately being rejected.

@xenadmin
Copy link

I'm unsure if I'm affected by #1201 or #1199, but this sounds 1% more like my issue.

I have 1 single user (me) on stalwart, with 1 single e-mail address (mine) and I only have 2 E-Mails in my Inbox, but I see 4 E-Mails on my iPhone's Inbox.
I have 3 IMAP Clients I use at the moment: iPadOS 18.2.1, Roundcube 1.6.9 and iOS 18.2.1. And only the iPhone is impacted.

Here are trace logs from stalwart this morning. I tried it two times and the relevant lines seem to be:

2025-02-14T08:13:27Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 40, contents = "\r\nL67 UID MOVE 112:113 "Deleted Items"\r\n"
2025-02-14T08:13:27Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:13:27Z DEBUG IMAP error occurred (imap.error) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, details = No messages were found., id = "L67"
2025-02-14T08:13:27Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 32, contents = "L67 NO No messages were found.\r\n"

Here is the complete log:

2025-02-14T08:10:30Z DEBUG IMAP connection started (imap.connection-start) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077
2025-02-14T08:10:30Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 88, contents = "L1 AUTHENTICATE PLAIN 123123123123123=\r\n"
2025-02-14T08:10:30Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:30Z INFO Authentication successful (auth.success) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, accountName = "[email protected]", accountId = 65
2025-02-14T08:10:30Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:30Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:30Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 384, contents = "L1 OK [CAPABILITY IMAP4rev2 IMAP4rev1 ENABLE SASL-IR LITERAL+ ID UTF8=ACCEPT IDLE NAMESPACE CHILDREN MULTIAPPEND BINARY UNSELECT ACL UIDPLUS ESEARCH WITHIN SEARCHRES SORT THREAD=REFERENCES LIST-EXTENDED LIST-STATUS ESORT SORT=DISPLAY SPECIAL-USE CREATE-SPECIAL-USE MOVE CONDSTORE QRESYNC UNAUTHENTICATE STATUS=SIZE OBJECTID PREVIEW QUOTA QUOTA=RES-STORAGE] Authentication successful\r\n"
2025-02-14T08:10:30Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 132, contents = "L2 ID ("name" "com.apple.email.maild" "version" "3826.300.87.2.22" "os" "iOS" "os-version" "18.2.1 (22C161)" "vendor" "Apple Inc")\r\n"
2025-02-14T08:10:30Z DEBUG IMAP ID command (imap.id) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, elapsed = 0ms
2025-02-14T08:10:30Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 134, contents = "* ID ("name" "Stalwart IMAP" "version" "0.11.4" "vendor" "Stalwart Labs Ltd." "support-url" "https://stalw.art")\r\nL2 OK ID completed\r\n"
2025-02-14T08:10:30Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 31, contents = "L3 SELECT "INBOX" (CONDSTORE)\r\n"
2025-02-14T08:10:30Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:30Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:30Z DEBUG IMAP SELECT command (imap.select) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, mailboxName = "INBOX", accountId = 65, mailboxId = 0, total = 2, uidNext = 117, uidValidity = 3930792974, elapsed = 0ms
2025-02-14T08:10:30Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 378, contents = "* 2 EXISTS\r\n* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n* 0 RECENT\r\n* OK [PERMANENTFLAGS (\\Deleted \\Seen \\Answered \\Flagged \\Draft \\*)] All allowed\r\n* OK [UIDVALIDITY 3930792974] UIDs valid\r\n* OK [UIDNEXT 117] Next predicted UID\r\n* OK [HIGHESTMODSEQ 224762049875775520] Highest Modseq\r\n* OK [MAILBOXID (ieaaaaaa)] Unique Mailbox ID\r\nL3 OK [READ-WRITE] SELECT completed\r\n"
2025-02-14T08:10:30Z DEBUG IMAP connection started (imap.connection-start) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 88, contents = "M1 AUTHENTICATE PLAIN 123123123123123=\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 39, contents = "L11 UID SEARCH RETURN (ALL) UID 1:120\r\n"
2025-02-14T08:10:31Z DEBUG IMAP SEARCH command (imap.search) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, accountId = 65, mailboxId = 0, total = 2, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 67, contents = "* ESEARCH (TAG "L11") UID ALL 83,116\r\nL11 OK UID SEARCH completed\r\n"
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z INFO Authentication successful (auth.success) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, accountName = "[email protected]", accountId = 65
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 384, contents = "M1 OK [CAPABILITY IMAP4rev2 IMAP4rev1 ENABLE SASL-IR LITERAL+ ID UTF8=ACCEPT IDLE NAMESPACE CHILDREN MULTIAPPEND BINARY UNSELECT ACL UIDPLUS ESEARCH WITHIN SEARCHRES SORT THREAD=REFERENCES LIST-EXTENDED LIST-STATUS ESORT SORT=DISPLAY SPECIAL-USE CREATE-SPECIAL-USE MOVE CONDSTORE QRESYNC UNAUTHENTICATE STATUS=SIZE OBJECTID PREVIEW QUOTA QUOTA=RES-STORAGE] Authentication successful\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 132, contents = "M2 ID ("name" "com.apple.email.maild" "version" "3826.300.87.2.22" "os" "iOS" "os-version" "18.2.1 (22C161)" "vendor" "Apple Inc")\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 37, contents = "L20 SELECT "Sent Items" (CONDSTORE)\r\n"
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z DEBUG IMAP ID command (imap.id) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 134, contents = "* ID ("name" "Stalwart IMAP" "version" "0.11.4" "vendor" "Stalwart Labs Ltd." "support-url" "https://stalw.art")\r\nM2 OK ID completed\r\n"
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z DEBUG IMAP SELECT command (imap.select) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, mailboxName = "Sent Items", accountId = 65, mailboxId = 4, total = 8, uidNext = 10, uidValidity = 3193443499, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 417, contents = "* OK [CLOSED] Closed previous mailbox\r\n* 8 EXISTS\r\n* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n* 0 RECENT\r\n* OK [PERMANENTFLAGS (\\Deleted \\Seen \\Answered \\Flagged \\Draft \\*)] All allowed\r\n* OK [UIDVALIDITY 3193443499] UIDs valid\r\n* OK [UIDNEXT 10] Next predicted UID\r\n* OK [HIGHESTMODSEQ 224762049875775520] Highest Modseq\r\n* OK [MAILBOXID (ieaaaaae)] Unique Mailbox ID\r\nL20 OK [READ-WRITE] SELECT completed\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 31, contents = "M3 SELECT "INBOX" (CONDSTORE)\r\n"
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z DEBUG IMAP SELECT command (imap.select) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, mailboxName = "INBOX", accountId = 65, mailboxId = 0, total = 2, uidNext = 117, uidValidity = 3930792974, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 378, contents = "* 2 EXISTS\r\n* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n* 0 RECENT\r\n* OK [PERMANENTFLAGS (\\Deleted \\Seen \\Answered \\Flagged \\Draft \\*)] All allowed\r\n* OK [UIDVALIDITY 3930792974] UIDs valid\r\n* OK [UIDNEXT 117] Next predicted UID\r\n* OK [HIGHESTMODSEQ 224762049875775520] Highest Modseq\r\n* OK [MAILBOXID (ieaaaaaa)] Unique Mailbox ID\r\nM3 OK [READ-WRITE] SELECT completed\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 38, contents = "L28 UID SEARCH RETURN (ALL) UID 1:10\r\n"
2025-02-14T08:10:31Z DEBUG IMAP SEARCH command (imap.search) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, accountId = 65, mailboxId = 4, total = 8, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 68, contents = "* ESEARCH (TAG "L28") UID ALL 1:6,8:9\r\nL28 OK UID SEARCH completed\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 32, contents = "M5 SELECT "Drafts" (CONDSTORE)\r\n"
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z DEBUG IMAP SELECT command (imap.select) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, mailboxName = "Drafts", accountId = 65, mailboxId = 3, total = 0, uidNext = 1, uidValidity = 2558652384, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 415, contents = "* OK [CLOSED] Closed previous mailbox\r\n* 0 EXISTS\r\n* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n* 0 RECENT\r\n* OK [PERMANENTFLAGS (\\Deleted \\Seen \\Answered \\Flagged \\Draft \\*)] All allowed\r\n* OK [UIDVALIDITY 2558652384] UIDs valid\r\n* OK [UIDNEXT 1] Next predicted UID\r\n* OK [HIGHESTMODSEQ 224762049875775520] Highest Modseq\r\n* OK [MAILBOXID (ieaaaaad)] Unique Mailbox ID\r\nM5 OK [READ-WRITE] SELECT completed\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 38, contents = "L35 UID SEARCH RETURN (ALL) UID 10:*\r\n"
2025-02-14T08:10:31Z DEBUG IMAP SEARCH command (imap.search) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, accountId = 65, mailboxId = 4, total = 1, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 62, contents = "* ESEARCH (TAG "L35") UID ALL 9\r\nL35 OK UID SEARCH completed\r\n"
2025-02-14T08:10:31Z DEBUG IMAP connection started (imap.connection-start) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 32, contents = "L38 SELECT "INBOX" (CONDSTORE)\r\n"
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z DEBUG IMAP SELECT command (imap.select) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, mailboxName = "INBOX", accountId = 65, mailboxId = 0, total = 2, uidNext = 117, uidValidity = 3930792974, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 418, contents = "* OK [CLOSED] Closed previous mailbox\r\n* 2 EXISTS\r\n* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n* 0 RECENT\r\n* OK [PERMANENTFLAGS (\\Deleted \\Seen \\Answered \\Flagged \\Draft \\*)] All allowed\r\n* OK [UIDVALIDITY 3930792974] UIDs valid\r\n* OK [UIDNEXT 117] Next predicted UID\r\n* OK [HIGHESTMODSEQ 224762049875775520] Highest Modseq\r\n* OK [MAILBOXID (ieaaaaaa)] Unique Mailbox ID\r\nL38 OK [READ-WRITE] SELECT completed\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 37, contents = "M19 UID SEARCH RETURN (ALL) UID 1:*\r\n"
2025-02-14T08:10:31Z DEBUG IMAP SEARCH command (imap.search) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, accountId = 65, mailboxId = 3, total = 0, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 56, contents = "* ESEARCH (TAG "M19") UID\r\nM19 OK UID SEARCH completed\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 88, contents = "N1 AUTHENTICATE PLAIN 123123123123123=\r\n"
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z INFO Authentication successful (auth.success) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, accountName = "[email protected]", accountId = 65
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 384, contents = "N1 OK [CAPABILITY IMAP4rev2 IMAP4rev1 ENABLE SASL-IR LITERAL+ ID UTF8=ACCEPT IDLE NAMESPACE CHILDREN MULTIAPPEND BINARY UNSELECT ACL UIDPLUS ESEARCH WITHIN SEARCHRES SORT THREAD=REFERENCES LIST-EXTENDED LIST-STATUS ESORT SORT=DISPLAY SPECIAL-USE CREATE-SPECIAL-USE MOVE CONDSTORE QRESYNC UNAUTHENTICATE STATUS=SIZE OBJECTID PREVIEW QUOTA QUOTA=RES-STORAGE] Authentication successful\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 39, contents = "L46 UID SEARCH RETURN (ALL) UID 1:120\r\n"
2025-02-14T08:10:31Z DEBUG IMAP SEARCH command (imap.search) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, accountId = 65, mailboxId = 0, total = 2, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 67, contents = "* ESEARCH (TAG "L46") UID ALL 83,116\r\nL46 OK UID SEARCH completed\r\n"
2025-02-14T08:10:31Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 132, contents = "N2 ID ("name" "com.apple.email.maild" "version" "3826.300.87.2.22" "os" "iOS" "os-version" "18.2.1 (22C161)" "vendor" "Apple Inc")\r\n"
2025-02-14T08:10:31Z DEBUG IMAP ID command (imap.id) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, elapsed = 0ms
2025-02-14T08:10:31Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 134, contents = "* ID ("name" "Stalwart IMAP" "version" "0.11.4" "vendor" "Stalwart Labs Ltd." "support-url" "https://stalw.art")\r\nN2 OK ID completed\r\n"
2025-02-14T08:10:32Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 10, contents = "M22 IDLE\r\n"
2025-02-14T08:10:32Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, size = 32, contents = "+ Idling, send 'DONE' to stop.\r\n"
2025-02-14T08:10:32Z DEBUG IMAP IDLE start (imap.idle-start) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64081, elapsed = 0ms
2025-02-14T08:10:32Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 10, contents = "L55 IDLE\r\n"
2025-02-14T08:10:32Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 32, contents = "+ Idling, send 'DONE' to stop.\r\n"
2025-02-14T08:10:32Z DEBUG IMAP IDLE start (imap.idle-start) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, elapsed = 0ms
2025-02-14T08:10:33Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 36, contents = "N3 SELECT "Sent Items" (CONDSTORE)\r\n"
2025-02-14T08:10:33Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:33Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:33Z DEBUG IMAP SELECT command (imap.select) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, mailboxName = "Sent Items", accountId = 65, mailboxId = 4, total = 8, uidNext = 10, uidValidity = 3193443499, elapsed = 0ms
2025-02-14T08:10:33Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 377, contents = "* 8 EXISTS\r\n* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n* 0 RECENT\r\n* OK [PERMANENTFLAGS (\\Deleted \\Seen \\Answered \\Flagged \\Draft \\*)] All allowed\r\n* OK [UIDVALIDITY 3193443499] UIDs valid\r\n* OK [UIDNEXT 10] Next predicted UID\r\n* OK [HIGHESTMODSEQ 224762049875775520] Highest Modseq\r\n* OK [MAILBOXID (ieaaaaae)] Unique Mailbox ID\r\nN3 OK [READ-WRITE] SELECT completed\r\n"
2025-02-14T08:10:33Z DEBUG IMAP IDLE stop (imap.idle-stop) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, elapsed = 1670ms
2025-02-14T08:10:33Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 23, contents = "L55 OK IDLE completed\r\n"
2025-02-14T08:10:33Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 36, contents = "\r\nL57 UID MOVE 113 "Deleted Items"\r\n"
2025-02-14T08:10:33Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:10:33Z DEBUG IMAP error occurred (imap.error) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, details = No messages were found., id = "L57"
2025-02-14T08:10:33Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 32, contents = "L57 NO No messages were found.\r\n"
2025-02-14T08:10:33Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 38, contents = "N11 UID SEARCH RETURN (ALL) UID 1:10\r\n"
2025-02-14T08:10:33Z DEBUG IMAP SEARCH command (imap.search) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, accountId = 65, mailboxId = 4, total = 8, elapsed = 0ms
2025-02-14T08:10:33Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 68, contents = "* ESEARCH (TAG "N11") UID ALL 1:6,8:9\r\nN11 OK UID SEARCH completed\r\n"
2025-02-14T08:10:34Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 38, contents = "N18 UID SEARCH RETURN (ALL) UID 10:*\r\n"
2025-02-14T08:10:34Z DEBUG IMAP SEARCH command (imap.search) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, accountId = 65, mailboxId = 4, total = 1, elapsed = 0ms
2025-02-14T08:10:34Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 62, contents = "* ESEARCH (TAG "N18") UID ALL 9\r\nN18 OK UID SEARCH completed\r\n"
2025-02-14T08:10:34Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 10, contents = "L59 IDLE\r\n"
2025-02-14T08:10:34Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 32, contents = "+ Idling, send 'DONE' to stop.\r\n"
2025-02-14T08:10:34Z DEBUG IMAP IDLE start (imap.idle-start) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, elapsed = 0ms
2025-02-14T08:10:35Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 10, contents = "N21 IDLE\r\n"
2025-02-14T08:10:35Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, size = 32, contents = "+ Idling, send 'DONE' to stop.\r\n"
2025-02-14T08:10:35Z DEBUG IMAP IDLE start (imap.idle-start) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64082, elapsed = 0ms
[... second try ...]
2025-02-14T08:13:27Z DEBUG IMAP IDLE stop (imap.idle-stop) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, elapsed = 28036ms
2025-02-14T08:13:27Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 23, contents = "L65 OK IDLE completed\r\n"
2025-02-14T08:13:27Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 40, contents = "\r\nL67 UID MOVE 112:113 "Deleted Items"\r\n"
2025-02-14T08:13:27Z TRACE Data store iteration operation (store.data-iterate) elapsed = 0ms
2025-02-14T08:13:27Z DEBUG IMAP error occurred (imap.error) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, details = No messages were found., id = "L67"
2025-02-14T08:13:27Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 32, contents = "L67 NO No messages were found.\r\n"
2025-02-14T08:13:28Z TRACE Raw IMAP input received (imap.raw-input) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 10, contents = "L69 IDLE\r\n"
2025-02-14T08:13:28Z TRACE Raw IMAP output sent (imap.raw-output) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, size = 32, contents = "+ Idling, send 'DONE' to stop.\r\n"
2025-02-14T08:13:28Z DEBUG IMAP IDLE start (imap.idle-start) listenerId = "imaptls", localPort = 993, remoteIp = 123.123.123.123, remotePort = 64077, elapsed = 0ms

@mdecimus
Copy link
Member

mdecimus commented Feb 14, 2025

@xenadmin Looking at your logs it looks like an Apple bug:

Here your client is selecting "Inbox" and Stalwart is indicating that there are only 2 messages.

* OK [CLOSED] Closed previous mailbox\r\n* 2 EXISTS\r\n* FLAGS (\\Answered \\Flagged \\Deleted \\Seen \\Draft)\r\n* 0 RECENT\r\n* OK [PERMANENTFLAGS (\\Deleted \\Seen \\Answered \\Flagged \\Draft \\*)] All allowed\r\n* OK [UIDVALIDITY 3930792974] UIDs valid\r\n* OK [UIDNEXT 117] Next predicted UID\r\n* OK [HIGHESTMODSEQ 224762049875775520] Highest Modseq\r\n* OK [MAILBOXID (ieaaaaaa)] Unique Mailbox ID\r\nL38 OK [READ-WRITE] SELECT completed\r\n

Here your client is searching for all messages in the folder and Stalwart indicates there are only two messages with UIDs 83 and 116:

L46 UID SEARCH RETURN (ALL) UID 1:120\r\n
* ESEARCH (TAG "L46") UID ALL 83,116\r\nL46 OK UID SEARCH completed\r\n

Then your client is trying to move message with UID 113 which is not included in the results:

L57 UID MOVE 113 "Deleted Items"\r\n
L57 NO No messages were found.\r\n

Can you check the logs prior to the ones you provided above? It might provide some hints on where is Apple Mail obtaining this UID 113 from.

Edit: Perhaps the message has been already moved but your client failed to parse the response.

@mdecimus
Copy link
Member

@mtomasek780 Similar to what I wrote above, please check in the logs previous occurrences of the UID 2142 as it no longer exists in that folder.

@mtomasek780
Copy link
Author

Happy to work to review and post those logs this weekend, @mdecimus . My only follow-up question is in my case, I have the same issue using Thunderbird on Fedora and Apple's mail apps, so does that change your opinion on my log at all?

@mdecimus
Copy link
Member

@mtomasek780 Yes, according to the logs posted the error message returned by Stalwart is correct because that UID does not appear in the results. We need to find out at which point the mail client got "confused" to believe that message is there.
My guess is that the message was successfully moved on the first try but the client had a problem parsing the response or something like that. We need to track down that UID to see what happened before.

@NathanHbt
Copy link

There seem to be two issues:

  1. On a recent Apple device, using Mail on macOS. If I select 10 emails and delete them, then press ctrl + z to undo the deletion, the emails return to my inbox. Then, if I click on one of these emails and select "delete" again, the email disappears for a second but reappears in the inbox. It is not deleted. This can be tested on a recent MacBook.

  2. On older Macs with Mail, recently received emails that have not been moved cannot be deleted. I click on a new unread email, click on "Delete," and the email is moved to the trash. However, during the next IMAP synchronization, the email returns to the inbox. I am unable to obtain logs because I only have 3 clients with this issue and do not have access to an old MacBook.

@tajohnson
Copy link

I can't turn up logging right now, But I wanted to add that I can reproduce situation #1 described by @NathanHbt :

  1. On a recent Apple device, using Mail on macOS. If I select 10 emails and delete them, then press ctrl + z to undo the deletion, the emails return to my inbox. Then, if I click on one of these emails and select "delete" again, the email disappears for a second but reappears in the inbox. It is not deleted. This can be tested on a recent MacBook.

I delete some messages, hit cmd-z to undo it, and then delete them again, and they reappear after a second in the mailbox.

@mdecimus
Copy link
Member

If you can reproduce this on a blank account and provide the raw IMAP logs from start to finish it will certainly help. I use Apple Mail on Mac and iOS and could not reproduce it unfortunately.

@mitchplze
Copy link

I have ran into this issue several times in the last few weeks also. After un-junking messages, they remain 'stuck' in the inbox and can't be archived or deleted. This affects my iOS device and Apple Mail on MacOS. I am unable to reproduce the issue right now of course, but I've definitely seen it as recently as two days ago.

@tajohnson
Copy link

My issue with finding the details in the logs is that I have hundreds of users, and only a few are reporting the issue, and typically not until late in the process, and I'm not in a position to tell them "okay, do it right now" or to sequester them to a different stalwart instance.

If you have any suggestions on how to pare down voluminous logs to find the ones that might most directly apply, I'm open to trying to filter out through hundreds of thousands of lines of logging data....

@mdecimus
Copy link
Member

If anyone in this thread can help by posting here the raw IMAP logs it will certainly help. I can't reproduce this issue on Mac or iOS. The logs provided before do not help because they show that your client is using a UID that no longer exists, so I need to see what happened before that point.

Perhaps you could create a fresh Stalwart setup on a temporary container, reproduce the issue with logging on and then send them over.

@NathanHbt
Copy link

I will try to do that by the end of the week, on a secondary instance.

@tajohnson
Copy link

I hope this helps.

I had the issue happen on an account and was able to grab the logs right away. There are thousands of users on this cluster of servers, but I found the smtp delivery of the message in question, and then pulled all the following entries based on the IP address of the user reading the message. They deleted the message, and it reappeared right away.

Mac OS Sequoia 15.1.1

stalwart_log.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants