Re: [PATCH 3/6] cli: make the hacky from guessing more liberal
authorMoritz Wilhelmy <mw+notmuch@barfooze.de>
Thu, 17 Oct 2013 13:58:04 +0000 (15:58 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:28 +0000 (09:57 -0800)
c7/0ecdeb2f9bbfb15b52e351f75bd25cc7e5092e [new file with mode: 0644]

diff --git a/c7/0ecdeb2f9bbfb15b52e351f75bd25cc7e5092e b/c7/0ecdeb2f9bbfb15b52e351f75bd25cc7e5092e
new file mode 100644 (file)
index 0000000..e5476c6
--- /dev/null
@@ -0,0 +1,89 @@
+Return-Path: <mw@barfooze.de>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3F190431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 17 Oct 2013 06:58:15 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id HVWhw5LYJcDg for <notmuch@notmuchmail.org>;\r
+       Thu, 17 Oct 2013 06:58:10 -0700 (PDT)\r
+Received: from furnace.wzff.de (furnace.wzff.de [176.9.216.40])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 65CAC431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 17 Oct 2013 06:58:10 -0700 (PDT)\r
+Received: from mw by furnace.wzff.de with local (Exim 4.80.1 (FreeBSD))\r
+       (envelope-from <mw@barfooze.de>) id 1VWo5U-000Mf7-Ba\r
+       for notmuch@notmuchmail.org; Thu, 17 Oct 2013 15:58:04 +0200\r
+Date: Thu, 17 Oct 2013 15:58:04 +0200\r
+From: Moritz Wilhelmy <mw+notmuch@barfooze.de>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: [PATCH 3/6] cli: make the hacky from guessing more liberal\r
+Message-ID: <20131017135804.GH49348@barfooze.de>\r
+References: <cover.1381948853.git.jani@nikula.org>\r
+       <7dd03cd9c1677be8c5937d11b376d4cbd26c64f5.1381948853.git.jani@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To:\r
+ <7dd03cd9c1677be8c5937d11b376d4cbd26c64f5.1381948853.git.jani@nikula.org>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 17 Oct 2013 13:58:15 -0000\r
+\r
+Hello,\r
+\r
+On Wed, Oct 16, 2013 at 22:00:10 +0300, Jani Nikula wrote:\r
+> This is in preparation of switching to gmime header parsing. Accept\r
+> "for" and "by" preceded by tabs in the received header. This is a bit\r
+> flaky, but so is the whole guessing code.\r
+> ---\r
+>  notmuch-reply.c | 4 ++--\r
+>  1 file changed, 2 insertions(+), 2 deletions(-)\r
+> \r
+> diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+> index 9d6f843..4b67e66 100644\r
+> --- a/notmuch-reply.c\r
+> +++ b/notmuch-reply.c\r
+> @@ -423,7 +423,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message\r
+>      /* First we look for a " for <email@add.res>" in the received\r
+>       * header\r
+>       */\r
+> -    ptr = strstr (received, " for ");\r
+> +    ptr = strstr (received, "for ");\r
+>  \r
+>      /* Note: ptr potentially contains a list of email addresses. */\r
+>      addr = user_address_in_string (ptr, config);\r
+> @@ -440,7 +440,7 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message\r
+>       * system in this step of the receive chain\r
+>       */\r
+>      by = received;\r
+> -    while((by = strstr (by, " by ")) != NULL) {\r
+> +    while((by = strstr (by, "by ")) != NULL) {\r
+>      by += 4;\r
+\r
+FWIW, I didn't read the rest of the code, but shouldn't the last line\r
+be changed to "by += 3" when you're dropping a space from the strstr?\r
+\r
+\r
+Best,\r
+\r
+Moritz\r