if (!h->deleted)
{
h->deleted = 1;
+ if (ctx->magic == M_MAILDIR && option(OPTMAILDIRTRASH))
+ {
+ /* As with the IMAP comment below, we need to mark the
+ * message and mailbox as changed, because deleting a message
+ * just changes its status on disk without actually deleting
+ * it. Without this, the 'T' flag would never get set when
+ * the maildir box is synched.
+ */
+ h->changed = 1;
+ if (upd_ctx) ctx->changed = 1;
+ }
if (upd_ctx) ctx->deleted++;
#ifdef USE_IMAP
/* deleted messages aren't treated as changed elsewhere so that the
{
h->deleted = 0;
if (upd_ctx) ctx->deleted--;
+ if (ctx->magic == M_MAILDIR && option(OPTMAILDIRTRASH))
+ {
+ /* As with the IMAP comment below, we need to mark the
+ * message and mailbox as changed, because deleting a message
+ * just changes its status on disk without actually deleting
+ * it. Without this, the 'T' flag would never get set when
+ * the maildir box is synched.
+ */
+ h->changed = 1;
+ if (upd_ctx) ctx->changed = 1;
+ }
#ifdef USE_IMAP
/* see my comment above */
if (ctx->magic == M_IMAP)
** \fBDON'T CHANGE THIS SETTING UNLESS YOU ARE REALLY SURE WHAT YOU ARE
** DOING!\fP
*/
+ { "maildir_trash", DT_BOOL, R_NONE, OPTMAILDIRTRASH, 0 },
+ /*
+ ** .pp
+ ** If set, messages marked as deleted will be saved with the maildir
+ ** (T)rashed flag instead of unlinked. \fBNOTE:\fP this only applies
+ ** to maildir-style mailboxes. Setting it will have no effect on other
+ ** mailbox types.
+ */
{ "mark_old", DT_BOOL, R_BOTH, OPTMARKOLD, 1 },
/*
** .pp
h->replied = 1;
break;
+
+ case 'T': /* trashed */
+
+ h->deleted = 1;
+ break;
}
p++;
}
{
*dest = '\0';
- if (hdr && (hdr->flagged || hdr->replied || hdr->read))
+ if (hdr && (hdr->flagged || hdr->replied || hdr->read || hdr->deleted))
{
snprintf (dest, destlen,
- ":2,%s%s%s",
+ ":2,%s%s%s%s",
hdr->flagged ? "F" : "",
hdr->replied ? "R" : "",
- hdr->read ? "S" : "");
+ hdr->read ? "S" : "",
+ hdr->deleted ? "T" : "");
}
}
for (i = 0; i < ctx->msgcount; i++)
{
- if (ctx->hdrs[i]->deleted)
+ if (ctx->hdrs[i]->deleted && (ctx->magic != M_MAILDIR || !option(OPTMAILDIRTRASH)))
{
snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path);
if (ctx->magic == M_MAILDIR || (option (OPTMHPURGE) && ctx->magic == M_MH))
#endif
OPTIMPLICITAUTOVIEW,
OPTMAILCAPSANITIZE,
+ OPTMAILDIRTRASH,
OPTMARKERS,
OPTMARKOLD,
OPTMENUSCROLL, /* scroll menu instead of implicit next-page */