From: Stephan Bosch Date: Wed, 13 Nov 2019 21:59:03 +0000 (+0100) Subject: lmtp: lmtp-commands - Fix application of the lmtp_hdr_delivery_address setting. X-Git-Tag: 2.3.10~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f501df29a594e2d4855dfa30d606379ee2af8f9f;p=thirdparty%2Fdovecot%2Fcore.git lmtp: lmtp-commands - Fix application of the lmtp_hdr_delivery_address setting. Its value was ignored. It got broken by the move to the new lib-smtp for v2.3. --- diff --git a/src/lmtp/lmtp-commands.c b/src/lmtp/lmtp-commands.c index 6a31213494..c4d5989825 100644 --- a/src/lmtp/lmtp-commands.c +++ b/src/lmtp/lmtp-commands.c @@ -115,8 +115,27 @@ cmd_data_create_added_headers(struct client *client, /* headers for local and proxied messages */ proxy_offset = str_len(str); if (client->lmtp_set->lmtp_add_received_header) { + const struct lmtp_settings *lmtp_set = client->lmtp_set; + enum smtp_server_trace_rcpt_to_address rcpt_to_address = + SMTP_SERVER_TRACE_RCPT_TO_ADDRESS_FINAL; + + switch (lmtp_set->parsed_lmtp_hdr_delivery_address) { + case LMTP_HDR_DELIVERY_ADDRESS_NONE: + rcpt_to_address = + SMTP_SERVER_TRACE_RCPT_TO_ADDRESS_NONE; + break; + case LMTP_HDR_DELIVERY_ADDRESS_FINAL: + rcpt_to_address = + SMTP_SERVER_TRACE_RCPT_TO_ADDRESS_FINAL; + break; + case LMTP_HDR_DELIVERY_ADDRESS_ORIGINAL: + rcpt_to_address = + SMTP_SERVER_TRACE_RCPT_TO_ADDRESS_ORIGINAL; + break; + } + smtp_server_transaction_write_trace_record( - str, trans, SMTP_SERVER_TRACE_RCPT_TO_ADDRESS_FINAL); + str, trans, rcpt_to_address); } client->state.added_headers_local =