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 17171431FBF
\r
6 for <notmuch@notmuchmail.org>; Wed, 19 Mar 2014 09:45:01 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id CaPaXe5veKzP for <notmuch@notmuchmail.org>;
\r
16 Wed, 19 Mar 2014 09:44:57 -0700 (PDT)
\r
17 Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com
\r
18 [74.125.83.52]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client
\r
19 certificate requested) by olra.theworths.org (Postfix) with ESMTPS id
\r
20 5569F431FAF for <notmuch@notmuchmail.org>; Wed, 19 Mar 2014 09:44:57 -0700
\r
22 Received: by mail-ee0-f52.google.com with SMTP id e49so6697150eek.25
\r
23 for <notmuch@notmuchmail.org>; Wed, 19 Mar 2014 09:44:54 -0700 (PDT)
\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
25 d=1e100.net; s=20130820;
\r
26 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
\r
28 bh=ZYgk1N422FXITOqmN3nTfM0xuLEGfgXh8q/J5SJSxv8=;
\r
29 b=W/DG0MUAtVNxLcj0s2Fa0A4wRCi2VwVTSzoWZPr/f9JhOGJfL+dr3vz/8gxSTnRLte
\r
30 7IrM+r48EupwFcGMrbCiQ3gnQKX6VyUpW9qa98Y7gfUZ0Dkc51PwSPLizncuTR/0duXZ
\r
31 A+02lqsgDMqXb4GTCOeF/ITIloioaHaA+2BgUTrvJifk2nEd2O7I5l4TyJGWjdJqdMXs
\r
32 ACPPF/AGnONtPxARgm7JSjf8+QT8aI93PGv3zI/hxPMjxz6KBe/hCyYKxofLD96De+Rd
\r
33 DzV0UiS5RtPcG2eXYAMmz9jeD6H2INvTD9LmrSA4XhPJDtqx9if1pBo58rad7aLg4DL/
\r
36 ALoCoQl0lvbhG9to0H2RP3NbxM3ROy0GZVh6VpJRKcz4lK3/873XDoJtugtPTjA/D6kfIYlNrh3f
\r
37 X-Received: by 10.14.105.4 with SMTP id j4mr23533068eeg.41.1395247494668;
\r
38 Wed, 19 Mar 2014 09:44:54 -0700 (PDT)
\r
39 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.
\r
41 by mx.google.com with ESMTPSA id n5sm5208328eex.14.2014.03.19.09.44.52
\r
42 for <multiple recipients>
\r
43 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
44 Wed, 19 Mar 2014 09:44:53 -0700 (PDT)
\r
45 From: Jani Nikula <jani@nikula.org>
\r
46 To: notmuch@notmuchmail.org
\r
47 Subject: [PATCH] cli: sanitize the received header before scanning for replies
\r
48 Date: Wed, 19 Mar 2014 18:44:50 +0200
\r
49 Message-Id: <1395247490-19892-1-git-send-email-jani@nikula.org>
\r
50 X-Mailer: git-send-email 1.9.0
\r
51 In-Reply-To: <20140203204611.GL4375@mit.edu>
\r
52 References: <20140203204611.GL4375@mit.edu>
\r
53 X-BeenThere: notmuch@notmuchmail.org
\r
54 X-Mailman-Version: 2.1.13
\r
56 List-Id: "Use and development of the notmuch mail system."
\r
57 <notmuch.notmuchmail.org>
\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
59 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
61 List-Post: <mailto:notmuch@notmuchmail.org>
\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
64 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
65 X-List-Received-Date: Wed, 19 Mar 2014 16:45:01 -0000
\r
67 This makes the from guessing agnostic to header folding by spaces or
\r
72 I haven't had the time to update the rest of the series, but get the
\r
73 prep patch out of the way.
\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 47993d223090..7c1c80959ed6 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 (NULL, 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