This way plugins, such as mail_log, can detect this.
/* max_mails is still being reached -> expunge.
don't even check saved-dates before we're
below max_mails. */
- mail_expunge(mail);
+ mail_autoexpunge(mail);
count++;
} else if (interval_time == 0) {
/* only max_mails is used. nothing further to do. */
} else if (mail_get_save_date(mail, ×tamp) == 0) {
if (I_MAX(last_rename_stamp, timestamp) > expire_time)
break;
- mail_expunge(mail);
+ mail_autoexpunge(mail);
count++;
} else if (mailbox_get_last_mail_error(box) == MAIL_ERROR_EXPUNGED) {
/* already expunged */
ARRAY(union mail_module_context *) module_contexts;
const char *get_stream_reason;
+
+ bool autoexpunged:1;
};
struct mailbox_list_context {
void mail_storage_copy_error(struct mail_storage *dest,
struct mail_storage *src);
+/* Indicate mail being expunged by autoexpunge */
+void mail_autoexpunge(struct mail *mail);
+
/* Returns TRUE if everything should already be in memory after this call
or if prefetching is not supported, i.e. the caller shouldn't do more
prefetching before this message is handled. */
} T_END;
}
+void mail_autoexpunge(struct mail *mail)
+{
+ struct mail_private *p = (struct mail_private *)mail;
+ p->autoexpunged = TRUE;
+ mail_expunge(mail);
+ p->autoexpunged = FALSE;
+}
+
void mail_set_expunged(struct mail *mail)
{
mail_storage_set_error(mail->box->storage, MAIL_ERROR_EXPUNGED,