changeset 21544:8851e74dd61f

lib-lda: Avoid using mailbox_save_set_dest_mail()
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 09 Feb 2017 18:49:53 +0200
parents eea5b9a884f8
children a79cac08f84c
files src/lib-lda/mail-deliver.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-lda/mail-deliver.c	Thu Feb 09 18:46:14 2017 +0200
+++ b/src/lib-lda/mail-deliver.c	Thu Feb 09 18:49:53 2017 +0200
@@ -375,9 +375,9 @@
 	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)
@@ -386,7 +386,6 @@
 		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);