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 BBF08431FBC for ; Thu, 17 Oct 2013 07:10:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 ZBYKJx5tbolU for ; Thu, 17 Oct 2013 07:10:50 -0700 (PDT) Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 303FA431FAE for ; Thu, 17 Oct 2013 07:10:50 -0700 (PDT) Received: by mail-ee0-f43.google.com with SMTP id e52so1091194eek.2 for ; Thu, 17 Oct 2013 07:10:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=IEd07YvC21rUK0zF1Ybv7Rw0CPN9UjKb4AQ4vsQ1Gco=; b=BlGh7tEaTJophZiUtoJTDqE2TQail3U1v1eUjA5t4MKAUeKD8uv6j06uXdQI3TWHau l0FxJGTZsry1bMp8IyoWbs4nlV7jqK840Iz7renJVW4EUqooqjyMWuJjlO8ffC76ydrH Eaco+B5nwaI/xkCyjsMSh/dg/i8LsDrgv0n78IdqOy262XX3366BXIJefQAqmHdzMqDa mW4BPqctzjBpERrLvu6nLUTyC5YLfnt7WEgT/2zvViJJIUfIKsmUg24vLuEQmnIVPaeT kutjhK3fLLjb0mizCtkF0bqj5lH65qVNKuaoUDqkblPmDPJFeiNgc8kOjdSklv3+1Y/+ 1rBw== X-Gm-Message-State: ALoCoQkibq6HsyeQr3JbiffPQYfA7L4xksl7blcZ1HLdfLfTDBKFvu++F8TH2FO/pa2/m3aGc5Rx X-Received: by 10.15.22.2 with SMTP id e2mr2128781eeu.89.1382018595820; Thu, 17 Oct 2013 07:03:15 -0700 (PDT) Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi. [88.195.111.91]) by mx.google.com with ESMTPSA id r48sm193385379eev.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 17 Oct 2013 07:03:14 -0700 (PDT) From: Jani Nikula To: Moritz Wilhelmy , notmuch@notmuchmail.org Subject: Re: [PATCH 3/6] cli: make the hacky from guessing more liberal In-Reply-To: <20131017135804.GH49348@barfooze.de> References: <7dd03cd9c1677be8c5937d11b376d4cbd26c64f5.1381948853.git.jani@nikula.org> <20131017135804.GH49348@barfooze.de> User-Agent: Notmuch/0.16+97~g6878b0b (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 17 Oct 2013 17:03:14 +0300 Message-ID: <87eh7kuh99.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain 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 14:10:54 -0000 On Thu, 17 Oct 2013, Moritz Wilhelmy wrote: > 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? Absolutely, same in the "for" case. Thanks. Jani. > > > Best, > > Moritz > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch