1 Return-Path: <prvs=396941042=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 16C0A431FC7
\r
6 for <notmuch@notmuchmail.org>; Sat, 22 Nov 2014 06:17:05 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\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 EgnpXUwT1KZS for <notmuch@notmuchmail.org>;
\r
16 Sat, 22 Nov 2014 06:16:59 -0800 (PST)
\r
17 Received: from smtpauth.johnshopkins.edu (smtpauth.johnshopkins.edu
\r
18 [128.220.229.177]) (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 E1089431FBF
\r
21 for <notmuch@notmuchmail.org>; Sat, 22 Nov 2014 06:16:58 -0800 (PST)
\r
22 X-IronPort-AV: E=Sophos;i="5.07,437,1413259200"; d="scan'208";a="140499136"
\r
23 Received: from c-69-137-43-192.hsd1.md.comcast.net (HELO localhost)
\r
25 by IPMTW4.johnshopkins.edu with ESMTP/TLS/AES128-SHA;
\r
26 22 Nov 2014 08:16:57 -0500
\r
27 From: Jesse Rosenthal <jrosenthal@jhu.edu>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [PATCH v3 2/2] lib: Use email address instead of empty real name.
\r
30 Date: Sat, 22 Nov 2014 08:17:16 -0500
\r
31 Message-Id: <1416662236-26556-3-git-send-email-jrosenthal@jhu.edu>
\r
32 X-Mailer: git-send-email 2.1.3
\r
33 In-Reply-To: <1416662236-26556-1-git-send-email-jrosenthal@jhu.edu>
\r
34 References: <1416662236-26556-1-git-send-email-jrosenthal@jhu.edu>
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.13
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Sat, 22 Nov 2014 14:17:05 -0000
\r
49 Currently, if a From-header is of the form:
\r
51 "" <address@example.com>
\r
53 the empty string will be treated as a valid real-name, and the entry
\r
54 in the search results will be empty.
\r
56 The new behavior here is that we treat an empty real-name field as if
\r
57 it were null, so that the email address will be used in the search
\r
60 Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
\r
62 lib/thread.cc | 3 ++-
\r
63 test/T205-author-naming.sh | 1 -
\r
64 2 files changed, 2 insertions(+), 2 deletions(-)
\r
66 diff --git a/lib/thread.cc b/lib/thread.cc
\r
67 index 8922403..79c3e9b 100644
\r
70 @@ -277,7 +277,8 @@ _thread_add_message (notmuch_thread_t *thread,
\r
71 address = internet_address_list_get_address (list, 0);
\r
73 author = internet_address_get_name (address);
\r
74 - if (author == NULL) {
\r
75 + /* We treat quoted empty names as if they were empty. */
\r
76 + if (author == NULL || author[0] == '\0') {
\r
77 InternetAddressMailbox *mailbox;
\r
78 mailbox = INTERNET_ADDRESS_MAILBOX (address);
\r
79 author = internet_address_mailbox_get_addr (mailbox);
\r
80 diff --git a/test/T205-author-naming.sh b/test/T205-author-naming.sh
\r
81 index 18819dd..cb678ae 100755
\r
82 --- a/test/T205-author-naming.sh
\r
83 +++ b/test/T205-author-naming.sh
\r
84 @@ -3,7 +3,6 @@ test_description="naming of authors with unusual addresses"
\r
87 test_begin_subtest "Add author with empty quoted real name"
\r
88 -test_subtest_known_broken
\r
89 add_message '[subject]="author-naming: Initial thread subject"' \
\r
90 '[date]="Fri, 05 Jan 2001 15:43:56 -0000"' \
\r
91 '[from]="\"\" <address@example.com>"'
\r