]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: local: Use recipient index in lmtp_local_rcpt_reply_overquota().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 31 Jan 2018 09:27:54 +0000 (10:27 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 31 Jan 2018 19:55:02 +0000 (20:55 +0100)
When used during the DATA command, it should send a reply for the correct
recipient. During the RCPT command there is only one reply due. Added assert
that checks this.

src/lmtp/lmtp-local.c

index c19c449e6121b3eb5cb7b5d3ec938f2894c00c6d..0b5e7e06ec909914b8a7b0ab29d2dab7f59abc90 100644 (file)
@@ -138,15 +138,18 @@ lmtp_local_rcpt_reply_overquota(struct lmtp_local_recipient *rcpt,
                                const char *error)
 {
        struct smtp_address *address = rcpt->rcpt.path;
+       unsigned int rcpt_idx = rcpt->rcpt.index;
        struct lda_settings *lda_set =
                mail_storage_service_user_get_set(rcpt->service_user)[2];
 
+       i_assert(rcpt_idx == 0 || rcpt->rcpt.rcpt_cmd == NULL);
+
        if (lda_set->quota_full_tempfail) {
-               smtp_server_reply(cmd, 452, "4.2.2", "<%s> %s",
-                                 smtp_address_encode(address), error);
+               smtp_server_reply_index(cmd, rcpt_idx, 452, "4.2.2", "<%s> %s",
+                                       smtp_address_encode(address), error);
        } else {
-               smtp_server_reply(cmd, 552, "5.2.2", "<%s> %s",
-                                 smtp_address_encode(address), error);
+               smtp_server_reply_index(cmd, rcpt_idx, 552, "5.2.2", "<%s> %s",
+                                       smtp_address_encode(address), error);
        }
 }