unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: jrosenthal@jhu.edu
Cc: notmuch@notmuchmail.org
Subject: [PATCH] notmuch-addresses: Match on the full name as well as components.
Date: Wed, 21 Dec 2011 13:49:17 +0000	[thread overview]
Message-ID: <1324475357-21700-1-git-send-email-dme@dme.org> (raw)

---
 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

             reply	other threads:[~2011-12-21 13:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21 13:49 David Edmondson [this message]
2011-12-30 19:04 ` [PATCH] notmuch-addresses: Match on the full name as well as components Jesse Rosenthal
2011-12-30 19:38   ` Jesse Rosenthal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324475357-21700-1-git-send-email-dme@dme.org \
    --to=dme@dme.org \
    --cc=jrosenthal@jhu.edu \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).