]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lda: Code cleanup - remove unnecessary dest_mail check
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 14 Feb 2017 18:23:16 +0000 (20:23 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 14 Feb 2017 18:23:16 +0000 (20:23 +0200)
src/lib-lda/mail-deliver.c

index cac4fa6aa853e84143e5f7756d3ad41d4888abd2..96b5c79b726e1357c8be34797c14c4c8491510b8 100644 (file)
@@ -114,11 +114,11 @@ const struct var_expand_table *
 mail_deliver_ctx_get_log_var_expand_table(struct mail_deliver_context *ctx,
                                          const char *message)
 {
-       struct mail *mail = ctx->dest_mail != NULL ?
-               ctx->dest_mail : ctx->src_mail;
        unsigned int delivery_time_msecs;
 
-       mail_deliver_log_update_cache(ctx, mail);
+       /* If a mail was saved/copied, the cache is already filled and the
+          following call is ignored. Otherwise, only the source mail exists. */
+       mail_deliver_log_update_cache(ctx, ctx->src_mail);
        /* This call finishes a mail delivery. With Sieve there may be multiple
           mail deliveries. */
        ctx->cache->filled = FALSE;