1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by arlo.cworth.org (Postfix) with ESMTP id 5EE336DE3948
\r
6 for <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:41:27 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=0.261 tagged_above=-999 required=5 tests=[AWL=0.981,
\r
13 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,
\r
14 RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled
\r
15 Received: from arlo.cworth.org ([127.0.0.1])
\r
16 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id Uh3o7gtWwd6T for <notmuch@notmuchmail.org>;
\r
18 Sat, 13 Aug 2016 04:41:19 -0700 (PDT)
\r
19 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com
\r
20 [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id 88BF26DE38C3 for
\r
21 <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:21 -0700 (PDT)
\r
22 Received: by mail-wm0-f66.google.com with SMTP id i138so2004722wmf.3
\r
23 for <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:21 -0700 (PDT)
\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=nikula-org.20150623.gappssmtp.com; s=20150623;
\r
26 h=from:to:cc:subject:date:message-id:in-reply-to:references
\r
27 :in-reply-to:references;
\r
28 bh=FgEWcwZwZNHGDLoYAMew8rAbVt2GXziMhF5ZA3VKnBg=;
\r
29 b=yxyVfzifAIjSe86Va0b+vOpw4OF4cY+tI+gB+Z6wGFAP+Q6j8oFqNHLK20fH6iG5rY
\r
30 L6nZVvnSlNtd+D+nfPfkOn23r84yZUFI5N0icQ7SS8FYKCS/0m7RKhC5b9vdCorXVwIr
\r
31 eCcJKN13HI8h7zXTeQPhWBjCTd9HtEEtmcQHeYE8Da71wowbcv9nSGYDTSgLOJPPYHcs
\r
32 fnlCW29CzKmXhqpW/tSbmgZz5m3jlifOHHwKGLRg3ON2ZRxqBxpEovUiR/5jH55BOhUi
\r
33 IuoCygv5h6a3mWgCW662Gif+sHc8x2K6P6zETzKv022TR7ZH3n+KgJnIaYzv08R/u/TG
\r
35 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
36 d=1e100.net; s=20130820;
\r
37 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
38 :references:in-reply-to:references;
\r
39 bh=FgEWcwZwZNHGDLoYAMew8rAbVt2GXziMhF5ZA3VKnBg=;
\r
40 b=ZZbk6isgkyl5mgkEsivzj+5d5A1Wib6XL/AWDmLfE05Z2wTnsy8aWI/oMARHOPQMO/
\r
41 4a5JFmsMipnsvtr6NCkFyye06ueHz6y2980YSAlqLA6cRPX99foGo2f10jCW1hLlfVJe
\r
42 T6Qwt5dRwbiH2dMEC+cHiKwky6T7cpRtqVKfr2nit6Xf/cPmX2ytjIWDFedYbAne98mv
\r
43 g2XSGWrv9eVBSXaXt0YCfbR1cWWXKPpFBpX1zhRucYOzPKyapyS7ig+gQUkxSlKU77zY
\r
44 jB7xdiponE1KULsLSZLCMi1WYwkKYs1a65+ojzOOkhbBNN2V8KSlh5pmeSzMpqaPZU2N
\r
47 AEkoousLcqwQxAqKNS6kdqXJanpkx88CrEXZcTk1HBfdbIna+cAhRcuJJYCTNualKeSX8w==
\r
48 X-Received: by 10.28.38.196 with SMTP id m187mr3227141wmm.81.1471088360208;
\r
49 Sat, 13 Aug 2016 04:39:20 -0700 (PDT)
\r
50 Received: from localhost (dsl-hkibrasgw2-58c368-70.dhcp.inet.fi.
\r
52 by smtp.gmail.com with ESMTPSA id d64sm6799981wmc.22.2016.08.13.04.39.19
\r
53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
54 Sat, 13 Aug 2016 04:39:19 -0700 (PDT)
\r
55 From: Jani Nikula <jani@nikula.org>
\r
56 To: notmuch@notmuchmail.org
\r
57 Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
\r
59 Subject: [PATCH v2 12/14] cli/reply: pass internet address list to munge
\r
61 Date: Sat, 13 Aug 2016 14:37:36 +0300
\r
63 <2bdf4c7e53829fed525671f9f8f874323737f814.1471088022.git.jani@nikula.org>
\r
64 X-Mailer: git-send-email 2.1.4
\r
65 In-Reply-To: <cover.1471088022.git.jani@nikula.org>
\r
66 References: <cover.1471088022.git.jani@nikula.org>
\r
67 In-Reply-To: <cover.1471088022.git.jani@nikula.org>
\r
68 References: <cover.1471088022.git.jani@nikula.org>
\r
69 X-BeenThere: notmuch@notmuchmail.org
\r
70 X-Mailman-Version: 2.1.20
\r
72 List-Id: "Use and development of the notmuch mail system."
\r
73 <notmuch.notmuchmail.org>
\r
74 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
75 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
76 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
77 List-Post: <mailto:notmuch@notmuchmail.org>
\r
78 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
79 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
80 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
81 X-List-Received-Date: Sat, 13 Aug 2016 11:41:27 -0000
\r
84 notmuch-reply.c | 20 ++++++++++++--------
\r
85 1 file changed, 12 insertions(+), 8 deletions(-)
\r
87 diff --git a/notmuch-reply.c b/notmuch-reply.c
\r
88 index 98034485c546..cf4248bd6794 100644
\r
89 --- a/notmuch-reply.c
\r
90 +++ b/notmuch-reply.c
\r
91 @@ -231,19 +231,18 @@ scan_address_list (InternetAddressList *list,
\r
92 * in either the 'To' or 'Cc' header of the message?
\r
95 -reply_to_header_is_redundant (notmuch_message_t *message, const char *reply_to)
\r
96 +reply_to_header_is_redundant (notmuch_message_t *message,
\r
97 + InternetAddressList *reply_to_list)
\r
99 const char *to, *cc, *addr;
\r
100 - InternetAddressList *list;
\r
101 InternetAddress *address;
\r
102 InternetAddressMailbox *mailbox;
\r
104 - list = internet_address_list_parse_string (reply_to);
\r
106 - if (internet_address_list_length (list) != 1)
\r
107 + if (reply_to_list == NULL ||
\r
108 + internet_address_list_length (reply_to_list) != 1)
\r
111 - address = internet_address_list_get_address (list, 0);
\r
112 + address = internet_address_list_get_address (reply_to_list, 0);
\r
113 if (INTERNET_ADDRESS_IS_GROUP (address))
\r
116 @@ -269,6 +268,8 @@ static InternetAddressList *get_sender(notmuch_message_t *message,
\r
118 reply_to = g_mime_message_get_reply_to (mime_message);
\r
119 if (reply_to && *reply_to) {
\r
120 + InternetAddressList *reply_to_list;
\r
123 * Some mailing lists munge the Reply-To header despite it
\r
124 * being A Bad Thing, see
\r
125 @@ -282,8 +283,11 @@ static InternetAddressList *get_sender(notmuch_message_t *message,
\r
126 * to the list. Note that the address in the Reply-To header
\r
127 * will always appear in the reply if reply_all is true.
\r
129 - if (! reply_to_header_is_redundant (message, reply_to))
\r
130 - return internet_address_list_parse_string (reply_to);
\r
131 + reply_to_list = internet_address_list_parse_string (reply_to);
\r
132 + if (! reply_to_header_is_redundant (message, reply_to_list))
\r
133 + return reply_to_list;
\r
135 + g_object_unref (G_OBJECT (reply_to_list));
\r
138 return internet_address_list_parse_string (
\r