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)
if (upd_ctx) ctx->changed = 1;
}
#endif
+ /*
+ * If the user undeletes a message which is marked as
+ * "trash" in the maildir folder on disk, the folder has
+ * been changed, and is marked accordingly. However, we do
+ * _not_ mark the message itself changed, because trashing
+ * is checked in specific code in the maildir folder
+ * driver.
+ */
+ if (ctx->magic == M_MAILDIR && upd_ctx && h->trash)
+ ctx->changed = 1;
}
break;
return mhs->flags[i];
}
+#if 0
+
+/* unused */
+
static short mhs_unset (struct mh_sequences *mhs, int i, short f)
{
mhs_alloc (mhs, i);
return mhs->flags[i];
}
+#endif
+
static void mh_read_token (char *t, int *first, int *last)
{
char *p;
break;
case 'T': /* trashed */
-
+ h->trash = 1;
h->deleted = 1;
break;
}
/* message hasn't really changed */
return 0;
}
+
+ /* record that the message is possibly marked as trashed on disk */
+ h->trash = h->deleted;
if (rename (oldpath, fullpath) != 0)
{
}
}
- else if (ctx->hdrs[i]->changed || ctx->hdrs[i]->attach_del)
+ else if (ctx->hdrs[i]->changed || ctx->hdrs[i]->attach_del ||
+ (ctx->magic == M_MAILDIR && (option (OPTMAILDIRTRASH) || ctx->hdrs[i]->trash)
+ && (ctx->hdrs[i]->deleted != ctx->hdrs[i]->trash)))
{
if (ctx->magic == M_MAILDIR)
{
unsigned int pgp : 4;
#endif
- unsigned int mime : 1; /* has a Mime-Version header? */
- unsigned int flagged : 1; /* marked important? */
+ unsigned int mime : 1; /* has a Mime-Version header? */
+ unsigned int flagged : 1; /* marked important? */
unsigned int tagged : 1;
unsigned int deleted : 1;
unsigned int changed : 1;
- unsigned int attach_del : 1; /* has an attachment marked for deletion */
+ unsigned int attach_del : 1; /* has an attachment marked for deletion */
unsigned int old : 1;
unsigned int read : 1;
- unsigned int expired : 1; /* already expired? */
- unsigned int superseded : 1; /* got superseded? */
+ unsigned int expired : 1; /* already expired? */
+ unsigned int superseded : 1; /* got superseded? */
unsigned int replied : 1;
- unsigned int subject_changed : 1; /* used for threading */
- unsigned int threaded : 1; /* used for threading */
- unsigned int display_subject : 1; /* used for threading */
- unsigned int recip_valid : 1; /* is_recipient is valid */
- unsigned int active : 1; /* message is not to be removed */
+ unsigned int subject_changed : 1; /* used for threading */
+ unsigned int threaded : 1; /* used for threading */
+ unsigned int display_subject : 1; /* used for threading */
+ unsigned int recip_valid : 1; /* is_recipient is valid */
+ unsigned int active : 1; /* message is not to be removed */
+ unsigned int trash : 1; /* message is marked as trashed on disk.
+ * This flag is used by the maildir_trash
+ * option.
+ */
/* timezone of the sender of this message */
unsigned int zhours : 5;
unsigned int matched : 1;
/* the following are used to support collapsing threads */
- unsigned int collapsed : 1; /* is this message part of a collapsed thread? */
- unsigned int limited : 1; /* is this message in a limited view? */
- size_t num_hidden; /* number of hidden messages in this view */
+ unsigned int collapsed : 1; /* is this message part of a collapsed thread? */
+ unsigned int limited : 1; /* is this message in a limited view? */
+ size_t num_hidden; /* number of hidden messages in this view */
- short recipient; /* user_is_recipient()'s return value, cached */
+ short recipient; /* user_is_recipient()'s return value, cached */
- int pair; /* color-pair to use when displaying in the index */
-
- time_t date_sent; /* time when the message was sent (UTC) */
- time_t received; /* time when the message was placed in the mailbox */
- long offset; /* where in the stream does this message begin? */
- int lines; /* how many lines in the body of this message? */
- int index; /* the absolute (unsorted) message number */
- int msgno; /* number displayed to the user */
- int virtual; /* virtual message number */
+ int pair; /* color-pair to use when displaying in the index */
+
+ time_t date_sent; /* time when the message was sent (UTC) */
+ time_t received; /* time when the message was placed in the mailbox */
+ long offset; /* where in the stream does this message begin? */
+ int lines; /* how many lines in the body of this message? */
+ int index; /* the absolute (unsorted) message number */
+ int msgno; /* number displayed to the user */
+ int virtual; /* virtual message number */
int score;
- ENVELOPE *env; /* envelope information */
- BODY *content; /* list of MIME parts */
+ ENVELOPE *env; /* envelope information */
+ BODY *content; /* list of MIME parts */
char *path;
- char *tree; /* character string to print thread tree */
+ char *tree; /* character string to print thread tree */
struct thread *thread;
#ifdef MIXMASTER
#endif
#ifdef USE_POP
- int refno; /* message number on server */
+ int refno; /* message number on server */
#endif
#if defined USE_POP || defined USE_IMAP
- void *data; /* driver-specific data */
+ void *data; /* driver-specific data */
#endif
} HEADER;