database error
[notmuch-archives.git] / 1d / add860c11627f774e7a3ed6e1a06582749079a
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 16718429E29\r
6         for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:41 -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 9Yx3Uq6OrEs0 for <notmuch@notmuchmail.org>;\r
17         Sat, 30 Mar 2013 07:21:39 -0700 (PDT)\r
18 Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com\r
19         [209.85.217.170]) (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 E0875429E31\r
22         for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:38 -0700 (PDT)\r
23 Received: by mail-lb0-f170.google.com with SMTP id x11so933806lbi.15\r
24         for <notmuch@notmuchmail.org>; Sat, 30 Mar 2013 07:21:37 -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=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
28         :references:in-reply-to:references:x-gm-message-state;\r
29         bh=xWT7v4w/lPNvS58CLQ4CB7qFG7xkfR25irff06EzRMI=;\r
30         b=i6U75+BXmhO5qT7hqezwpxfx2ptJuCa2h+KVaeB43pww9ixwxOYW53IoJvyLgMNoGi\r
31         KwYxHriAVncRbxwkNM88sMG/GBtu1Y74Wl78QepJ6tHzMCiDMBPsPCh+0WIVLxJ7SEtX\r
32         RBbQmaNIwzWxknIoTQS5bUIGNZxQX3qpRLGPtabdys1lzidG4B9dknKjCE51inAmn8We\r
33         bkw4EoBDNbR5X7iqOBydvjbHFAf1QBo78l8RiFnUGILdIInPSlmcqQ5Q+8zj+B1IvkHM\r
34         86XKUKTeJl5sZlhrXw+Fp+5mZIC/5h/JSZfSfjyspnoIyJF2VKqp1bKedpcZP4t8jiAQ\r
35         alDg==\r
36 X-Received: by 10.112.173.39 with SMTP id bh7mr2956174lbc.62.1364653297399;\r
37         Sat, 30 Mar 2013 07:21:37 -0700 (PDT)\r
38 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.\r
39         [80.223.81.27])\r
40         by mx.google.com with ESMTPS id fq10sm2651415lbb.14.2013.03.30.07.21.35\r
41         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
42         Sat, 30 Mar 2013 07:21:36 -0700 (PDT)\r
43 From: Jani Nikula <jani@nikula.org>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH v2 3/3] cli: support Mail-Followup-To: in notmuch reply\r
46 Date: Sat, 30 Mar 2013 16:21:22 +0200\r
47 Message-Id:\r
48  <390947231bc5d4fc4cb3b3aff94cd32bf25180f3.1364652420.git.jani@nikula.org>\r
49 X-Mailer: git-send-email 1.7.10.4\r
50 In-Reply-To: <cover.1364652420.git.jani@nikula.org>\r
51 References: <cover.1364652420.git.jani@nikula.org>\r
52 In-Reply-To: <cover.1364652420.git.jani@nikula.org>\r
53 References: <cover.1364652420.git.jani@nikula.org>\r
54 X-Gm-Message-State:\r
55  ALoCoQlsmyZv2Z70cAjuKG+DrvJaaWlceGnjayoVqx24Nve02cdswTfdn9kesRtODdfeivU3WRZV\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: Sat, 30 Mar 2013 14:21:41 -0000\r
69 \r
70 Use Mail-Followup-To header to determine recipients according to\r
71 http://cr.yp.to/proto/replyto.html if configured and present in the\r
72 message being replied to.\r
73 ---\r
74  notmuch-reply.c |   25 +++++++++++++++++++++++--\r
75  1 file changed, 23 insertions(+), 2 deletions(-)\r
76 \r
77 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
78 index e151f78..7391886 100644\r
79 --- a/notmuch-reply.c\r
80 +++ b/notmuch-reply.c\r
81 @@ -324,6 +324,7 @@ add_recipients_from_message (GMimeMessage *reply,\r
82         { "bcc",        NULL, GMIME_RECIPIENT_TYPE_BCC }\r
83      };\r
84      const char *from_addr = NULL;\r
85 +    const char *recipients;\r
86      unsigned int i;\r
87      unsigned int n = 0;\r
88  \r
89 @@ -343,9 +344,29 @@ add_recipients_from_message (GMimeMessage *reply,\r
90         reply_to_map[0].fallback = NULL;\r
91      }\r
92  \r
93 -    for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {\r
94 -       const char *recipients;\r
95 +    /* Use Mail-Followup-To header to determine recipients according\r
96 +     * to http://cr.yp.to/proto/replyto.html if configured and present\r
97 +     * in the message being replied to.\r
98 +     */\r
99 +    if (reply_all && notmuch_config_get_reply_honor_followup_to (config)) {\r
100 +       recipients = notmuch_message_get_header (message, "mail-followup-to");\r
101 +       if (recipients && *recipients) {\r
102 +           n = scan_address_string (recipients, config, reply,\r
103 +                                    GMIME_RECIPIENT_TYPE_TO, &from_addr);\r
104 +           if (n) {\r
105 +               /* Same rationale as in the loop below. */\r
106 +               reply = NULL;\r
107 +\r
108 +               /* From address and some recipients are enough, bail out. */\r
109 +               if (from_addr)\r
110 +                   return from_addr;\r
111 +\r
112 +               /* Else need to find from address in other headers. */\r
113 +           }\r
114 +       }\r
115 +    }\r
116  \r
117 +    for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {\r
118         recipients = notmuch_message_get_header (message,\r
119                                                  reply_to_map[i].header);\r
120         if ((recipients == NULL || recipients[0] == '\0') && reply_to_map[i].fallback)\r
121 -- \r
122 1.7.10.4\r
123 \r