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 olra.theworths.org (Postfix) with ESMTP id 2A2A1431FBC
\r
6 for <notmuch@notmuchmail.org>; Mon, 3 Feb 2014 11:52:44 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id EungCdJOoANT for <notmuch@notmuchmail.org>;
\r
17 Mon, 3 Feb 2014 11:52:40 -0800 (PST)
\r
18 Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com
\r
19 [74.125.83.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
20 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
21 D6195431FAF for <notmuch@notmuchmail.org>; Mon, 3 Feb 2014 11:52:09 -0800
\r
23 Received: by mail-ee0-f47.google.com with SMTP id d49so3828953eek.20
\r
24 for <notmuch@notmuchmail.org>; Mon, 03 Feb 2014 11:52:08 -0800 (PST)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=1e100.net; s=20130820;
\r
27 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
28 :references:in-reply-to:references;
\r
29 bh=JKL4q0NcwwMW+X4vuzPJGyeaaLNVo8HvF2YsNXxwPfo=;
\r
30 b=CkK/AKGJvLOCLIDu6eHMUe8K+YIzC2e0NoBRdfdy5bceqdUYp6vMa6hgSIlp0caeA6
\r
31 KBPYZLVdtoaFNy9RsQFthcYU5izSxrIueCB10LZqjHpy/JQjT+H41EqfW2QEZUnVqPTF
\r
32 FZC0pMBb/JdPTk9IY6ptkDoJFHGexYQNOpLmK+aROT2rBlXiYAggjX8WKkIqp1X0N189
\r
33 wDfs4Vh2z6mK+THIHCOLePrxS2Ej50VwWuQ9ate129iMtbSM91lP4A025FHqGRyMRgBm
\r
34 zKgwelsOfe/y2ZCYK3IF204juOwsWzBuKH5hTv8B/f22ZyLpewCq77XRmNYeEZZMxU3O
\r
37 ALoCoQll34WFVhBR1S/vKdrf3GkdqyN5CZJUetKRPjQe+1O5bODGTA02z1jaAwg+2gD7Qda9DDh5
\r
38 X-Received: by 10.15.61.7 with SMTP id h7mr10466550eex.49.1391457128563;
\r
39 Mon, 03 Feb 2014 11:52:08 -0800 (PST)
\r
40 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
42 by mx.google.com with ESMTPSA id m1sm78836622een.7.2014.02.03.11.52.06
\r
43 for <multiple recipients>
\r
44 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
45 Mon, 03 Feb 2014 11:52:07 -0800 (PST)
\r
46 From: Jani Nikula <jani@nikula.org>
\r
47 To: notmuch@notmuchmail.org
\r
48 Subject: [PATCH v3 4/6] cli: sanitize the received header before scanning for
\r
50 Date: Mon, 3 Feb 2014 21:51:44 +0200
\r
52 <df154611af9e23ef443f56c5abb90c8b276b18e7.1391456555.git.jani@nikula.org>
\r
53 X-Mailer: git-send-email 1.8.5.2
\r
54 In-Reply-To: <cover.1391456555.git.jani@nikula.org>
\r
55 References: <cover.1391456555.git.jani@nikula.org>
\r
56 In-Reply-To: <cover.1391456555.git.jani@nikula.org>
\r
57 References: <cover.1391456555.git.jani@nikula.org>
\r
58 X-BeenThere: notmuch@notmuchmail.org
\r
59 X-Mailman-Version: 2.1.13
\r
61 List-Id: "Use and development of the notmuch mail system."
\r
62 <notmuch.notmuchmail.org>
\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
66 List-Post: <mailto:notmuch@notmuchmail.org>
\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
69 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
70 X-List-Received-Date: Mon, 03 Feb 2014 19:52:44 -0000
\r
72 This makes the from guessing agnostic to header folding by spaces or
\r
75 notmuch-reply.c | 12 ++++++++++--
\r
76 1 file changed, 10 insertions(+), 2 deletions(-)
\r
78 diff --git a/notmuch-reply.c b/notmuch-reply.c
\r
79 index 47993d2..3f7021e 100644
\r
80 --- a/notmuch-reply.c
\r
81 +++ b/notmuch-reply.c
\r
85 #include "notmuch-client.h"
\r
86 +#include "string-util.h"
\r
87 #include "sprinter.h"
\r
90 @@ -465,14 +466,21 @@ guess_from_in_received_headers (notmuch_config_t *config,
\r
91 notmuch_message_t *message)
\r
93 const char *received, *addr;
\r
96 received = notmuch_message_get_header (message, "received");
\r
100 - addr = guess_from_in_received_for (config, received);
\r
101 + sanitized = sanitize_string (config, received);
\r
105 + addr = guess_from_in_received_for (config, sanitized);
\r
107 - addr = guess_from_in_received_by (config, received);
\r
108 + addr = guess_from_in_received_by (config, sanitized);
\r
110 + talloc_free (sanitized);
\r