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 D6B97429E2E for ; Wed, 21 Dec 2011 05:49:29 -0800 (PST) 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 IdcKHrhSar6J for ; Wed, 21 Dec 2011 05:49:29 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 3F8D6431FB6 for ; Wed, 21 Dec 2011 05:49:29 -0800 (PST) Received: by werm12 with SMTP id m12so3359418wer.26 for ; Wed, 21 Dec 2011 05:49:27 -0800 (PST) Received: by 10.216.131.223 with SMTP id m73mr8926405wei.52.1324475367904; Wed, 21 Dec 2011 05:49:27 -0800 (PST) Received: from hotblack-desiato.hh.sledj.net (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25]) by mx.google.com with ESMTPS id ej17sm5912486wbb.14.2011.12.21.05.49.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Dec 2011 05:49:27 -0800 (PST) Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000) id 0665CA024F; Wed, 21 Dec 2011 13:49:25 +0000 (GMT) From: David Edmondson To: jrosenthal@jhu.edu Subject: [PATCH] notmuch-addresses: Match on the full name as well as components. Date: Wed, 21 Dec 2011 13:49:17 +0000 Message-Id: <1324475357-21700-1-git-send-email-dme@dme.org> X-Mailer: git-send-email 1.7.7.3 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: Wed, 21 Dec 2011 13:49:30 -0000 --- 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