[PATCH] notmuch-addresses: Match on the full name as well as components.

Jesse Rosenthal jrosenthal at jhu.edu
Fri Dec 30 11:04:43 PST 2011


Pushed.

Thanks,
Jesse

On Wed, 21 Dec 2011 13:49:17 +0000, David Edmondson <dme at dme.org> 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
> 


More information about the notmuch mailing list