[PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 7b / c81a21157a93cd7ece73f7d2b06abce25f5d6b
1 Return-Path: <jani@nikula.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 60864431FC4\r
6         for <notmuch@notmuchmail.org>; Wed, 23 May 2012 22:15:58 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id LtC102gNK2BL for <notmuch@notmuchmail.org>;\r
17         Wed, 23 May 2012 22:15:57 -0700 (PDT)\r
18 Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
19         [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 505C1431FCB\r
22         for <notmuch@notmuchmail.org>; Wed, 23 May 2012 22:15:57 -0700 (PDT)\r
23 Received: by mail-lpp01m010-f53.google.com with SMTP id u2so6544458lag.26\r
24         for <notmuch@notmuchmail.org>; Wed, 23 May 2012 22:15:57 -0700 (PDT)\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
26         d=google.com; s=20120113;\r
27         h=from:to:subject:date:message-id:x-mailer:in-reply-to:references\r
28         :in-reply-to:references:x-gm-message-state;\r
29         bh=nylrmk7S/AtggMxVo1srfVLB3InySZ4Jb2tIuxC/CXQ=;\r
30         b=ftJkeyuLixJYaXa8ii5ZSWZjn2N8P4yoBVyGq/2dB+2lKKA/58j3iHXyV/PWj4hWdd\r
31         JCw/8FR48pjP9WjKzS8Mw/Mjgv3OhvYc6DjmVjdaiX10uBpCc9qYav/zpw0e4ZbpkcX/\r
32         SqKoSJBJ3wLUrGR+2WcF0A1DmVWYeQ4WkwCBDPJLPiuS3yi2nU7425C7RXDi+NBUzfKl\r
33         EgF7jsG/0yTnCNNvKzGv5z67LigKAX39reX6oODciz3dKqWqK2w8ApLy7NCpmReDbPsC\r
34         5rdSfqwoelHSqBVpwpIbaDgh76L0V7+jsesxVGwg9cV81Fj5y+9+g46rKD03+Nd0cocR\r
35         wBXQ==\r
36 Received: by 10.152.123.244 with SMTP id md20mr29734624lab.0.1337836556872;\r
37         Wed, 23 May 2012 22:15:56 -0700 (PDT)\r
38 Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.\r
39         [80.220.80.68])\r
40         by mx.google.com with ESMTPS id tt8sm578444lbb.16.2012.05.23.22.15.55\r
41         (version=SSLv3 cipher=OTHER); Wed, 23 May 2012 22:15:56 -0700 (PDT)\r
42 From: Jani Nikula <jani@nikula.org>\r
43 To: notmuch@notmuchmail.org\r
44 Subject: [PATCH v2 1/2] cli: also use Delivered-To header to figure out the\r
45         reply from address\r
46 Date: Thu, 24 May 2012 08:15:49 +0300\r
47 Message-Id:\r
48  <486cc9d33e43f3afba4bcdab71a489a36e453893.1337836150.git.jani@nikula.org>\r
49 X-Mailer: git-send-email 1.7.9.5\r
50 In-Reply-To: <cover.1337836150.git.jani@nikula.org>\r
51 References: <cover.1337836150.git.jani@nikula.org>\r
52 In-Reply-To: <cover.1337836150.git.jani@nikula.org>\r
53 References: <cover.1337836150.git.jani@nikula.org>\r
54 X-Gm-Message-State:\r
55  ALoCoQnzOUBW1EQd4DVxo/jfsE+a1Obl5cH6R4r6PkN0JBkWZ52NTgEaxfcWKu/ASSXaKaaST9J/\r
56 X-BeenThere: notmuch@notmuchmail.org\r
57 X-Mailman-Version: 2.1.13\r
58 Precedence: list\r
59 List-Id: "Use and development of the notmuch mail system."\r
60         <notmuch.notmuchmail.org>\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
64 List-Post: <mailto:notmuch@notmuchmail.org>\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
68 X-List-Received-Date: Thu, 24 May 2012 05:15:58 -0000\r
69 \r
70 Add another fallback header Delivered-To for guessing the user's from\r
71 address for notmuch reply before using the Received\r
72 headers. Apparently some MTAs use Delivered-To instead of\r
73 X-Original-To (which already exists as a fallback).\r
74 \r
75 Reported-by: Michael Hudson-Doyle <michael.hudson@canonical.com>\r
76 Signed-off-by: Jani Nikula <jani@nikula.org>\r
77 ---\r
78  notmuch-reply.c |   11 ++++++++---\r
79  1 file changed, 8 insertions(+), 3 deletions(-)\r
80 \r
81 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
82 index 51cb6de..0f92a2e 100644\r
83 --- a/notmuch-reply.c\r
84 +++ b/notmuch-reply.c\r
85 @@ -384,7 +384,11 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message\r
86      const char *delim=". \t";\r
87      size_t i;\r
88  \r
89 -    const char *to_headers[] = {"Envelope-to", "X-Original-To"};\r
90 +    const char *to_headers[] = {\r
91 +       "Envelope-to",\r
92 +       "X-Original-To",\r
93 +       "Delivered-To",\r
94 +    };\r
95  \r
96      /* sadly, there is no standard way to find out to which email\r
97       * address a mail was delivered - what is in the headers depends\r
98 @@ -395,8 +399,9 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message\r
99       * the To: or Cc: header. From here we try the following in order:\r
100       * 1) check for an Envelope-to: header\r
101       * 2) check for an X-Original-To: header\r
102 -     * 3) check for a (for <email@add.res>) clause in Received: headers\r
103 -     * 4) check for the domain part of known email addresses in the\r
104 +     * 3) check for a Delivered-To: header\r
105 +     * 4) check for a (for <email@add.res>) clause in Received: headers\r
106 +     * 5) check for the domain part of known email addresses in the\r
107       *    'by' part of Received headers\r
108       * If none of these work, we give up and return NULL\r
109       */\r
110 -- \r
111 1.7.9.5\r
112 \r