From: Timo Sirainen Date: Tue, 20 Jul 2010 20:07:44 +0000 (+0100) Subject: lmtp: Don't write "+ext" part to Delivered-To: header. X-Git-Tag: 2.0.rc3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8873384cf1429232ec1b44f5e856f6748c158607;p=thirdparty%2Fdovecot%2Fcore.git lmtp: Don't write "+ext" part to Delivered-To: header. --- diff --git a/src/lmtp/commands.c b/src/lmtp/commands.c index 6c36bf91bd..8d4f715604 100644 --- a/src/lmtp/commands.c +++ b/src/lmtp/commands.c @@ -673,18 +673,20 @@ static void client_proxy_finish(bool timeout, void *context) static const char *client_get_added_headers(struct client *client) { string_t *str = t_str_new(200); - const char *host, *rcpt_to = NULL; + const char *host, *address = NULL, *username = NULL; if (array_count(&client->state.rcpt_to) == 1) { const struct mail_recipient *rcpt = array_idx(&client->state.rcpt_to, 0); + const char *detail; - rcpt_to = rcpt->address; + address = rcpt->address; + rcpt_address_parse(client, address, &username, &detail); } str_printfa(str, "Return-Path: <%s>\r\n", client->state.mail_from); - if (rcpt_to != NULL) - str_printfa(str, "Delivered-To: <%s>\r\n", rcpt_to); + if (username != NULL) + str_printfa(str, "Delivered-To: <%s>\r\n", username); str_printfa(str, "Received: from %s", client->state.lhlo); if ((host = net_ip2addr(&client->remote_ip)) != NULL) @@ -693,8 +695,8 @@ static const char *client_get_added_headers(struct client *client) client->my_domain, client->state.session_id); str_append(str, "\r\n\t"); - if (rcpt_to != NULL) - str_printfa(str, "for <%s>", rcpt_to); + if (address != NULL) + str_printfa(str, "for <%s>", address); str_printfa(str, "; %s\r\n", message_date_create(ioloop_time)); return str_c(str); }