1 Return-Path: <prvs=395835c76=jrosenthal@jhu.edu>
\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 0B84E431FB6
\r
6 for <notmuch@notmuchmail.org>; Fri, 21 Nov 2014 07:47:18 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 vxjEbggcTaiw for <notmuch@notmuchmail.org>;
\r
16 Fri, 21 Nov 2014 07:47:11 -0800 (PST)
\r
17 Received: from smtpauth.johnshopkins.edu (smtpauth.johnshopkins.edu
\r
18 [162.129.8.200]) (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 8E25F431FAE
\r
21 for <notmuch@notmuchmail.org>; Fri, 21 Nov 2014 07:47:11 -0800 (PST)
\r
22 X-IronPort-AV: E=Sophos;i="5.07,432,1413259200"; d="scan'208";a="448181124"
\r
23 Received: from guppy.hwcampus.jhu.edu (HELO localhost) ([10.161.32.234])
\r
24 by IPEB3.johnshopkins.edu with ESMTP/TLS/AES128-SHA;
\r
25 21 Nov 2014 10:47:09 -0500
\r
26 From: Jesse Rosenthal <jrosenthal@jhu.edu>
\r
27 To: notmuch@notmuchmail.org
\r
28 Subject: [PATCH 1/2] lib: Use email address instead of empty real name.
\r
29 Date: Fri, 21 Nov 2014 10:46:43 -0500
\r
30 Message-Id: <1416584803-24018-1-git-send-email-jrosenthal@jhu.edu>
\r
31 X-Mailer: git-send-email 2.1.3
\r
32 X-BeenThere: notmuch@notmuchmail.org
\r
33 X-Mailman-Version: 2.1.13
\r
35 List-Id: "Use and development of the notmuch mail system."
\r
36 <notmuch.notmuchmail.org>
\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
38 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
40 List-Post: <mailto:notmuch@notmuchmail.org>
\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
44 X-List-Received-Date: Fri, 21 Nov 2014 15:47:18 -0000
\r
46 Currently, if a From-header is of the form:
\r
48 "" <address@example.com>
\r
50 the empty string will be treated as a valid real-name, and the entry
\r
51 in the search results will be empty.
\r
53 The new behavior here is that we treat an empty real-name field as if
\r
54 it were null, so that the email address will be used in the search
\r
57 Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
\r
59 lib/thread.cc | 3 ++-
\r
60 1 file changed, 2 insertions(+), 1 deletion(-)
\r
62 diff --git a/lib/thread.cc b/lib/thread.cc
\r
63 index 8922403..68b2b94 100644
\r
66 @@ -277,7 +277,8 @@ _thread_add_message (notmuch_thread_t *thread,
\r
67 address = internet_address_list_get_address (list, 0);
\r
69 author = internet_address_get_name (address);
\r
70 - if (author == NULL) {
\r
71 + // We treat quoted empty names as if they were empty.
\r
72 + if (author == NULL || author[0]=='\0' ) {
\r
73 InternetAddressMailbox *mailbox;
\r
74 mailbox = INTERNET_ADDRESS_MAILBOX (address);
\r
75 author = internet_address_mailbox_get_addr (mailbox);
\r
80 >From 90fd4673e08fccef95dcc0050bdcac3773d336a9 Mon Sep 17 00:00:00 2001
\r
81 From: Jesse Rosenthal <jrosenthal@jhu.edu>
\r
82 Date: Fri, 21 Nov 2014 10:24:16 -0500
\r
83 Subject: [PATCH 2/2] test: Add test for correct naming of author.
\r
85 This is a new test file, since handling of unusual email addresses
\r
86 doesn't seem to fit well in any of our existing tests.
\r
88 Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
\r
90 test/T205-author-naming.sh | 12 ++++++++++++
\r
91 1 file changed, 12 insertions(+)
\r
92 create mode 100755 test/T205-author-naming.sh
\r
94 diff --git a/test/T205-author-naming.sh b/test/T205-author-naming.sh
\r
95 new file mode 100755
\r
96 index 0000000..cb678ae
\r
98 +++ b/test/T205-author-naming.sh
\r
100 +#!/usr/bin/env bash
\r
101 +test_description="naming of authors with unusual addresses"
\r
104 +test_begin_subtest "Add author with empty quoted real name"
\r
105 +add_message '[subject]="author-naming: Initial thread subject"' \
\r
106 + '[date]="Fri, 05 Jan 2001 15:43:56 -0000"' \
\r
107 + '[from]="\"\" <address@example.com>"'
\r
108 +output=$(notmuch search --sort=oldest-first author-naming and tag:inbox | notmuch_search_sanitize)
\r
109 +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] address@example.com; author-naming: Initial thread subject (inbox unread)"
\r