]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: commands: Grouped deliver context field assignments by topic in client_deliver().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 17 Oct 2017 23:03:03 +0000 (01:03 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 26 Nov 2017 20:30:01 +0000 (22:30 +0200)
src/lmtp/commands.c

index c2399aa67f6ae354f852d53006b6efd2682f54d5..89071f165e2e2c95025252d9142e7b4dfece6847 100644 (file)
@@ -790,14 +790,13 @@ client_deliver(struct client *client, const struct mail_recipient *rcpt,
        dctx.smtp_set = smtp_set;
        dctx.session_id = rcpt->session_id;
        dctx.src_mail = src_mail;
+
+       /* MAIL FROM */
        dctx.mail_from = client->state.mail_from;
        dctx.mail_params = client->state.mail_params;
-       dctx.rcpt_user = dest_user;
-       dctx.session_time_msecs =
-               timeval_diff_msecs(&client->state.data_end_timeval,
-                                  &client->state.mail_from_timeval);
-       dctx.delivery_time_started = delivery_time_started;
 
+       /* RCPT TO */
+       dctx.rcpt_user = dest_user;
        dctx.rcpt_params = rcpt->params;
        if (dctx.rcpt_params.orcpt.addr != NULL) {
                /* used ORCPT */
@@ -820,6 +819,11 @@ client_deliver(struct client *client, const struct mail_recipient *rcpt,
        dctx.save_dest_mail = array_count(&client->state.rcpt_to) > 1 &&
                client->state.first_saved_mail == NULL;
 
+       dctx.session_time_msecs =
+               timeval_diff_msecs(&client->state.data_end_timeval,
+                                  &client->state.mail_from_timeval);
+       dctx.delivery_time_started = delivery_time_started;
+
        if (mail_deliver(&dctx, &storage) == 0) {
                if (dctx.dest_mail != NULL) {
                        i_assert(client->state.first_saved_mail == NULL);