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 B1F88431FB6 for ; Fri, 30 Dec 2011 11:37:55 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[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 EVlQdoLOPUVw for ; Fri, 30 Dec 2011 11:37:54 -0800 (PST) Received: from ipex2.johnshopkins.edu (ipex2.johnshopkins.edu [162.129.8.151]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 92726429E25 for ; Fri, 30 Dec 2011 11:37:54 -0800 (PST) X-IronPort-AV: E=Sophos;i="4.71,433,1320642000"; d="scan'208";a="113203161" Received: from unknown (HELO watt) ([10.161.33.18]) by ipex2.johnshopkins.edu with ESMTP/TLS/AES256-SHA; 30 Dec 2011 14:37:53 -0500 Received: from jkr by watt with local (Exim 4.76) (envelope-from ) id 1RgiHK-0004oT-Do; Fri, 30 Dec 2011 14:38:10 -0500 From: Jesse Rosenthal To: David Edmondson Subject: Re: [PATCH] notmuch-addresses: Match on the full name as well as components. In-Reply-To: <8739c17ues.fsf@jhu.edu> References: <1324475357-21700-1-git-send-email-dme@dme.org> <8739c17ues.fsf@jhu.edu> User-Agent: Notmuch/0.10.2 (http://notmuchmail.org) Emacs/23.3.1 (i686-pc-linux-gnu) Date: Fri, 30 Dec 2011 14:38:10 -0500 Message-ID: <87wr9d6eal.fsf@jhu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org 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: Fri, 30 Dec 2011 19:37:55 -0000 Oh, and I moved the code to http://commonmeasure.org/~jkr/notmuch_addresses.git Best, Jesse On Fri, 30 Dec 2011 14:04:43 -0500, Jesse Rosenthal wrote: > Pushed. > > Thanks, > Jesse > > On Wed, 21 Dec 2011 13:49:17 +0000, David Edmondson wrote: > > --- > > notmuch_addresses.py | 7 +++++-- > > 1 files changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/notmuch_addresses.py b/notmuch_addresses.py > > index bf45151..74a743c 100755 > > --- a/notmuch_addresses.py > > +++ b/notmuch_addresses.py > > @@ -164,11 +164,14 @@ class NotmuchAddressMatcher(object): > > addrs.append(v) > > parsed_addrs = email.utils.getaddresses(addrs) > > for addr in parsed_addrs: > > - mail = addr[1].lower() > > - split_names = addr[0].split(" ") > > + full_name = addr[0] > > + split_names = full_name.split(" ") > > + mail = addr[1] > > if (len([name for name in split_names > > if self.match_function(name)]) > 0 > > or > > + self.match_function(full_name) > > + or > > self.match_function(mail)): > > > > emails.add_email_and_name(mail, addr[0]) > > -- > > 1.7.7.3 > >