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