struct mail_save_context {
struct mailbox_transaction_context *transaction;
struct mail *dest_mail;
+ /* Set during mailbox_copy(). This is useful when copying is
+ implemented via save, and the save_*() methods want to access the
+ source mail. */
+ struct mail *copy_src_mail;
/* data that changes for each saved mail */
struct mail_save_data data;
}
i_assert(!ctx->copying_or_moving);
+ i_assert(ctx->copy_src_mail == NULL);
ctx->copying_or_moving = TRUE;
+ ctx->copy_src_mail = mail;
ctx->finishing = TRUE;
T_BEGIN {
ret = t->box->v.copy(ctx, backend_mail);
mailbox_keywords_unref(&keywords);
i_assert(!ctx->unfinished);
+ ctx->copy_src_mail = NULL;
ctx->copying_via_save = FALSE;
ctx->copying_or_moving = FALSE;
ctx->saving = FALSE; /* if we came from mailbox_save_using_mail() */