1 Return-Path: <dme@dme.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id D6B97429E2E
\r
6 for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 05:49:29 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id IdcKHrhSar6J for <notmuch@notmuchmail.org>;
\r
16 Wed, 21 Dec 2011 05:49:29 -0800 (PST)
\r
17 Received: from mail-we0-f181.google.com (mail-we0-f181.google.com
\r
18 [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 3F8D6431FB6
\r
21 for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 05:49:29 -0800 (PST)
\r
22 Received: by werm12 with SMTP id m12so3359418wer.26
\r
23 for <notmuch@notmuchmail.org>; Wed, 21 Dec 2011 05:49:27 -0800 (PST)
\r
24 Received: by 10.216.131.223 with SMTP id m73mr8926405wei.52.1324475367904;
\r
25 Wed, 21 Dec 2011 05:49:27 -0800 (PST)
\r
26 Received: from hotblack-desiato.hh.sledj.net
\r
27 (host81-149-164-25.in-addr.btopenworld.com. [81.149.164.25])
\r
28 by mx.google.com with ESMTPS id ej17sm5912486wbb.14.2011.12.21.05.49.26
\r
29 (version=TLSv1/SSLv3 cipher=OTHER);
\r
30 Wed, 21 Dec 2011 05:49:27 -0800 (PST)
\r
31 Received: by hotblack-desiato.hh.sledj.net (Postfix, from userid 30000)
\r
32 id 0665CA024F; Wed, 21 Dec 2011 13:49:25 +0000 (GMT)
\r
33 From: David Edmondson <dme@dme.org>
\r
34 To: jrosenthal@jhu.edu
\r
35 Subject: [PATCH] notmuch-addresses: Match on the full name as well as
\r
37 Date: Wed, 21 Dec 2011 13:49:17 +0000
\r
38 Message-Id: <1324475357-21700-1-git-send-email-dme@dme.org>
\r
39 X-Mailer: git-send-email 1.7.7.3
\r
40 Cc: notmuch@notmuchmail.org
\r
41 X-BeenThere: notmuch@notmuchmail.org
\r
42 X-Mailman-Version: 2.1.13
\r
44 List-Id: "Use and development of the notmuch mail system."
\r
45 <notmuch.notmuchmail.org>
\r
46 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
47 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
48 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
49 List-Post: <mailto:notmuch@notmuchmail.org>
\r
50 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
51 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
53 X-List-Received-Date: Wed, 21 Dec 2011 13:49:30 -0000
\r
56 notmuch_addresses.py | 7 +++++--
\r
57 1 files changed, 5 insertions(+), 2 deletions(-)
\r
59 diff --git a/notmuch_addresses.py b/notmuch_addresses.py
\r
60 index bf45151..74a743c 100755
\r
61 --- a/notmuch_addresses.py
\r
62 +++ b/notmuch_addresses.py
\r
63 @@ -164,11 +164,14 @@ class NotmuchAddressMatcher(object):
\r
65 parsed_addrs = email.utils.getaddresses(addrs)
\r
66 for addr in parsed_addrs:
\r
67 - mail = addr[1].lower()
\r
68 - split_names = addr[0].split(" ")
\r
69 + full_name = addr[0]
\r
70 + split_names = full_name.split(" ")
\r
72 if (len([name for name in split_names
\r
73 if self.match_function(name)]) > 0
\r
75 + self.match_function(full_name)
\r
77 self.match_function(mail)):
\r
79 emails.add_email_and_name(mail, addr[0])
\r