Skip to content

Commit

Permalink
lmtp: local: Use recipient index in lmtp_local_rcpt_reply_overquota().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stephanbosch authored and villesavolainen committed Feb 15, 2018
1 parent c81bd71 commit 254cae6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lmtp/lmtp-local.c
Expand Up @@ -135,15 +135,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);
}
}

Expand Down

0 comments on commit 254cae6

Please sign in to comment.