[RFC PATCH 0/6] cli/reply: refactoring part 2
[notmuch-archives.git] / c7 / 0ecdeb2f9bbfb15b52e351f75bd25cc7e5092e
1 Return-Path: <mw@barfooze.de>\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 3F190431FB6\r
6         for <notmuch@notmuchmail.org>; Thu, 17 Oct 2013 06:58:15 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 HVWhw5LYJcDg for <notmuch@notmuchmail.org>;\r
16         Thu, 17 Oct 2013 06:58:10 -0700 (PDT)\r
17 Received: from furnace.wzff.de (furnace.wzff.de [176.9.216.40])\r
18         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 65CAC431FAE\r
21         for <notmuch@notmuchmail.org>; Thu, 17 Oct 2013 06:58:10 -0700 (PDT)\r
22 Received: from mw by furnace.wzff.de with local (Exim 4.80.1 (FreeBSD))\r
23         (envelope-from <mw@barfooze.de>) id 1VWo5U-000Mf7-Ba\r
24         for notmuch@notmuchmail.org; Thu, 17 Oct 2013 15:58:04 +0200\r
25 Date: Thu, 17 Oct 2013 15:58:04 +0200\r
26 From: Moritz Wilhelmy <mw+notmuch@barfooze.de>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: Re: [PATCH 3/6] cli: make the hacky from guessing more liberal\r
29 Message-ID: <20131017135804.GH49348@barfooze.de>\r
30 References: <cover.1381948853.git.jani@nikula.org>\r
31         <7dd03cd9c1677be8c5937d11b376d4cbd26c64f5.1381948853.git.jani@nikula.org>\r
32 MIME-Version: 1.0\r
33 Content-Type: text/plain; charset=us-ascii\r
34 Content-Disposition: inline\r
35 In-Reply-To:\r
36  <7dd03cd9c1677be8c5937d11b376d4cbd26c64f5.1381948853.git.jani@nikula.org>\r
37 User-Agent: Mutt/1.5.21 (2010-09-15)\r
38 X-BeenThere: notmuch@notmuchmail.org\r
39 X-Mailman-Version: 2.1.13\r
40 Precedence: list\r
41 List-Id: "Use and development of the notmuch mail system."\r
42         <notmuch.notmuchmail.org>\r
43 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
45 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
46 List-Post: <mailto:notmuch@notmuchmail.org>\r
47 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
48 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
50 X-List-Received-Date: Thu, 17 Oct 2013 13:58:15 -0000\r
51 \r
52 Hello,\r
53 \r
54 On Wed, Oct 16, 2013 at 22:00:10 +0300, Jani Nikula wrote:\r
55 > This is in preparation of switching to gmime header parsing. Accept\r
56 > "for" and "by" preceded by tabs in the received header. This is a bit\r
57 > flaky, but so is the whole guessing code.\r
58 > ---\r
59 >  notmuch-reply.c | 4 ++--\r
60 >  1 file changed, 2 insertions(+), 2 deletions(-)\r
61\r
62 > diff --git a/notmuch-reply.c b/notmuch-reply.c\r
63 > index 9d6f843..4b67e66 100644\r
64 > --- a/notmuch-reply.c\r
65 > +++ b/notmuch-reply.c\r
66 > @@ -423,7 +423,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message\r
67 >      /* First we look for a " for <email@add.res>" in the received\r
68 >       * header\r
69 >       */\r
70 > -    ptr = strstr (received, " for ");\r
71 > +    ptr = strstr (received, "for ");\r
72 >  \r
73 >      /* Note: ptr potentially contains a list of email addresses. */\r
74 >      addr = user_address_in_string (ptr, config);\r
75 > @@ -440,7 +440,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message\r
76 >       * system in this step of the receive chain\r
77 >       */\r
78 >      by = received;\r
79 > -    while((by = strstr (by, " by ")) != NULL) {\r
80 > +    while((by = strstr (by, "by ")) != NULL) {\r
81 >       by += 4;\r
82 \r
83 FWIW, I didn't read the rest of the code, but shouldn't the last line\r
84 be changed to "by += 3" when you're dropping a space from the strstr?\r
85 \r
86 \r
87 Best,\r
88 \r
89 Moritz\r