]> 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>
Fri, 17 Feb 2017 09:32:32 +0000 (11:32 +0200)
src/lib-lda/mail-deliver.c

index c881a343db4be380094295e710b11c0840a77986..1fb070fc3f8aa40b2fdf9f2d7a4be3f20e7955d7 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;