]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lda: Avoid using mailbox_save_set_dest_mail()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 9 Feb 2017 16:49:53 +0000 (18:49 +0200)
committerGitLab <gitlab@git.dovecot.net>
Tue, 14 Feb 2017 12:57:34 +0000 (14:57 +0200)
src/lib-lda/mail-deliver.c

index cce5caaabce442c24d833c4a39f8cf46a4013b4e..25d264c82bb836c7cf1954386abe60f51c95ddf9 100644 (file)
@@ -372,9 +372,9 @@ int mail_deliver_save(struct mail_deliver_context *ctx, const char *mailbox,
        mailbox_save_set_flags(save_ctx, flags, kw);
 
        headers_ctx = mailbox_header_lookup_init(box, lda_log_wanted_headers);
-       ctx->dest_mail = mail_alloc(t, lda_log_wanted_fetch_fields, NULL);
+       ctx->dest_mail = mailbox_save_get_dest_mail(save_ctx);
+       mail_add_temp_wanted_fields(ctx->dest_mail, lda_log_wanted_fetch_fields, NULL);
        mailbox_header_lookup_unref(&headers_ctx);
-       mailbox_save_set_dest_mail(save_ctx, ctx->dest_mail);
        mail_deliver_deduplicate_guid_if_needed(ctx->session, save_ctx);
 
        if (mailbox_save_using_mail(&save_ctx, ctx->src_mail) < 0)
@@ -383,7 +383,6 @@ int mail_deliver_save(struct mail_deliver_context *ctx, const char *mailbox,
                mail_deliver_log_cache_var_expand_table(ctx);
        if (kw != NULL)
                mailbox_keywords_unref(&kw);
-       mail_free(&ctx->dest_mail);
 
        if (ret < 0)
                mailbox_transaction_rollback(&t);