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 3E59C431FB6 for ; Thu, 17 Oct 2013 01:11:39 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.148 X-Spam-Level: X-Spam-Status: No, score=0.148 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_BL_SPAMCOP_NET=1.246, RCVD_IN_DNSWL_MED=-2.3] 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 W76O8k8t69f5 for ; Thu, 17 Oct 2013 01:11:35 -0700 (PDT) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4990A431FAE for ; Thu, 17 Oct 2013 01:11:35 -0700 (PDT) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1VWig9-00015Q-A6; Thu, 17 Oct 2013 09:11:33 +0100 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) (envelope-from ) id 1VWig8-0002Nu-WD; Thu, 17 Oct 2013 09:11:33 +0100 From: Mark Walters To: Jani Nikula , notmuch@notmuchmail.org Subject: Re: [PATCH 3/6] cli: make the hacky from guessing more liberal In-Reply-To: <7dd03cd9c1677be8c5937d11b376d4cbd26c64f5.1381948853.git.jani@nikula.org> References: <7dd03cd9c1677be8c5937d11b376d4cbd26c64f5.1381948853.git.jani@nikula.org> User-Agent: Notmuch/0.15.2+334~gafd5c6a (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Thu, 17 Oct 2013 09:11:31 +0100 Message-ID: <87li1sb9l8.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 5ba659eccdfd841c24be8792a840488c (of first 20000 bytes) X-SpamAssassin-Score: 0.0 X-SpamAssassin-SpamBar: / X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored 0.0 points. Summary of the scoring: * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * 0.0 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean 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 08:11:39 -0000 On Wed, 16 Oct 2013, 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. I am happy with the change but I think a little more explanation of the problem it fixes would be helpful. Is it that there could be a \n \t before the "for"/"by" or something else? > --- > 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 "); The comment should be updated to match the code (and depending on the answer to the above maybe explain that too) Best wishes Mark > > /* 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; > if (*by == '\0') > break; > -- > 1.8.4.rc3 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch