/* mail was copied using saving */
unsigned int copying_via_save:1;
+ /* mail is being saved, not copied */
+ unsigned int saving:1;
};
struct mailbox_sync_context {
return -1;
}
+ (*ctx)->saving = TRUE;
if (box->v.save_begin == NULL) {
mail_storage_set_error(box->storage, MAIL_ERROR_NOTPOSSIBLE,
"Saving messages not supported");
return ret;
}
+int mailbox_save_using_mail(struct mail_save_context **ctx, struct mail *mail)
+{
+ (*ctx)->saving = TRUE;
+ return mailbox_copy(ctx, mail);
+}
+
bool mailbox_is_inconsistent(struct mailbox *box)
{
return box->mailbox_deleted || box->v.is_inconsistent(box);
/* Copy the given message. You'll need to specify the flags etc. using the
mailbox_save_*() functions. */
int mailbox_copy(struct mail_save_context **ctx, struct mail *mail);
+/* Same as mailbox_copy(), but treat the message as if it's being saved,
+ not copied. (For example: New mail delivered to multiple maildirs, with
+ each mails being hard link copies.) */
+int mailbox_save_using_mail(struct mail_save_context **ctx, struct mail *mail);
struct mail *mail_alloc(struct mailbox_transaction_context *t,
enum mail_fetch_field wanted_fields,