mail: graceful fallback when the IMAP server lacks UIDPLUS (targeted expunge throws) #319

Closed
opened 2026-07-04 07:27:35 +00:00 by JMR-dev · 0 comments
JMR-dev commented 2026-07-04 07:27:35 +00:00 (Migrated from github.com)

Follow-up to #295/#318. The new targeted UID EXPUNGE (IMAPFolder.expunge(Message[])) throws MessagingException("UID EXPUNGE not supported") on a server WITHOUT the UIDPLUS capability, rather than falling back to an untargeted expunge() — which is the correct SAFE outcome (fail-loud, no data loss), but means delete/expunge stops working entirely on a non-UIDPLUS IMAP server. Gmail/Outlook and most modern servers advertise UIDPLUS so the common case is fine; this covers rare self-hosted/legacy servers. Options: surface a clear user-facing error, OR fall back to an untargeted expunge only when it's provably safe (no other \Deleted-flagged messages in the folder). Backlog — edge case, current behavior is data-loss-safe.

Follow-up to #295/#318. The new targeted `UID EXPUNGE` (`IMAPFolder.expunge(Message[])`) throws `MessagingException("UID EXPUNGE not supported")` on a server WITHOUT the UIDPLUS capability, rather than falling back to an untargeted `expunge()` — which is the correct SAFE outcome (fail-loud, no data loss), but means **delete/expunge stops working entirely on a non-UIDPLUS IMAP server**. Gmail/Outlook and most modern servers advertise UIDPLUS so the common case is fine; this covers rare self-hosted/legacy servers. Options: surface a clear user-facing error, OR fall back to an untargeted expunge only when it's provably safe (no other `\Deleted`-flagged messages in the folder). Backlog — edge case, current behavior is data-loss-safe.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: JMR-dev/LibreMail#319