diff options
author | Kevin McCarthy <kevin@8t8.us> | 2023-03-12 19:54:44 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2023-03-12 19:54:44 -0700 |
commit | 3263c95379b315534d0a2371068a1987cf048471 (patch) | |
tree | b862323d57bcf94fdc31a7bba4254eadf18fd716 | |
parent | 277a12d110abb06a0233db34a32e291a44fc4533 (diff) | |
parent | 9f01d4ab0b8af067897612a46ef5cb8b4f38b699 (diff) |
Merge branch 'stable'
-rw-r--r-- | imap/imap.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/imap/imap.c b/imap/imap.c index b92c2dcf..20b10ee4 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -2519,6 +2519,25 @@ int imap_fast_trash (CONTEXT* ctx, char* dest) return 1; } + /* Scan if any of the messages were previously checkpoint-deleted + * on the server, by answering "no" to $delete for instance. + * In that case, doing a UID COPY would also copy the deleted flag, which + * is probably not desired. Trying to work around that leads to all sorts + * of headaches, so just force a manual append. + */ + for (n = 0; n < ctx->msgcount; n++) + { + if (ctx->hdrs[n]->active && + ctx->hdrs[n]->deleted && !ctx->hdrs[n]->purge && + HEADER_DATA(ctx->hdrs[n])->deleted) + { + dprint (1, (debugfile, + "imap_fast_trash: server-side delete flag set. aborting.\n")); + rc = -1; + goto out; + } + } + imap_fix_path (idata, mx.mbox, mbox, sizeof (mbox)); if (!*mbox) strfcpy (mbox, "INBOX", sizeof (mbox)); |