]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lmtp: Don't write "+ext" part to Delivered-To: header.
authorTimo Sirainen <tss@iki.fi>
Tue, 20 Jul 2010 20:07:44 +0000 (21:07 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 20 Jul 2010 20:07:44 +0000 (21:07 +0100)
src/lmtp/commands.c

index 6c36bf91bdafe9728a2740ee954bb009df6eda0a..8d4f71560475238096eabe84fad5d3dfda055ee7 100644 (file)
@@ -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);
 }