[PATCH 1/3] reply: add message-id header
authorFelipe Contreras <felipe.contreras@gmail.com>
Thu, 9 Dec 2010 22:32:50 +0000 (00:32 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:40 +0000 (09:37 -0800)
9c/8b927373e52cd182eb2c8c2be10c9432d77a9e [new file with mode: 0644]

diff --git a/9c/8b927373e52cd182eb2c8c2be10c9432d77a9e b/9c/8b927373e52cd182eb2c8c2be10c9432d77a9e
new file mode 100644 (file)
index 0000000..941d55b
--- /dev/null
@@ -0,0 +1,108 @@
+Return-Path: <felipe.contreras@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id A292E41A54C\r
+       for <notmuch@notmuchmail.org>; Thu,  9 Dec 2010 14:32:57 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id d+S88QQd0dEX for <notmuch@notmuchmail.org>;\r
+       Thu,  9 Dec 2010 14:32:57 -0800 (PST)\r
+Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com\r
+       [209.85.214.52])\r
+       by olra.theworths.org (Postfix) with ESMTP id 14110431FD0\r
+       for <notmuch@notmuchmail.org>; Thu,  9 Dec 2010 14:32:56 -0800 (PST)\r
+Received: by mail-bw0-f52.google.com with SMTP id 4so3710179bwz.39\r
+       for <notmuch@notmuchmail.org>; Thu, 09 Dec 2010 14:32:56 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:received:received:from:to:cc:subject:date\r
+       :message-id:x-mailer:in-reply-to:references;\r
+       bh=tgyLTsj/kUCsuggzDQyTNQN3MZD9BNxtc9TUXZf+c5c=;\r
+       b=iU+wsURgDKcxombql8knNj61+l14bAlQ/PjmYTnV4i9rtjB9j8cZ/Rv3u6W6IubThv\r
+       sOWqK7pxm1cMFh4frLn7mkyvnMJ1UbA8LFhlgbAwN6xRJjfHJ+j20wLpzGdu1/ajfJJm\r
+       VJQEVzjMJBr4i830N7JPyh0mrper1q94PdT4M=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       b=RyrlCYhRXK/mKYzf3LbyANRrLWrxS2IYyo9dRGUAU7ovLxhm+U+XnvPyJmiBNDWrF7\r
+       99s/rElhNn55Nx8k0TQxSMmc3L4oTm3kP0TYcJdJxOsVUDCFlIv/y3b9YhU5l+cwIPhu\r
+       19CWlxRICsmHm4Esoo99FDvbKT2CoEdUqbRkA=\r
+Received: by 10.204.46.130 with SMTP id j2mr4020128bkf.169.1291933976702;\r
+       Thu, 09 Dec 2010 14:32:56 -0800 (PST)\r
+Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80])\r
+       by mx.google.com with ESMTPS id\r
+       a17sm1220372bku.11.2010.12.09.14.32.55\r
+       (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
+       Thu, 09 Dec 2010 14:32:56 -0800 (PST)\r
+From: Felipe Contreras <felipe.contreras@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/3] reply: add message-id header\r
+Date: Fri, 10 Dec 2010 00:32:50 +0200\r
+Message-Id: <1291933972-7186-2-git-send-email-felipe.contreras@gmail.com>\r
+X-Mailer: git-send-email 1.7.3.2\r
+In-Reply-To: <1291933972-7186-1-git-send-email-felipe.contreras@gmail.com>\r
+References: <1291933972-7186-1-git-send-email-felipe.contreras@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 09 Dec 2010 22:32:57 -0000\r
+\r
+Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+---\r
+ notmuch-reply.c |   11 +++++++++++\r
+ 1 files changed, 11 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+index 23d04b8..53a12c5 100644\r
+--- a/notmuch-reply.c\r
++++ b/notmuch-reply.c\r
+@@ -447,6 +447,8 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_\r
+     notmuch_message_t *message;\r
+     const char *subject, *from_addr = NULL;\r
+     const char *in_reply_to, *orig_references, *references;\r
++    const char *message_id;\r
++    char *simple_from;\r
\r
+     for (messages = notmuch_query_search_messages (query);\r
+        notmuch_messages_valid (messages);\r
+@@ -476,6 +478,8 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_\r
+       if (from_addr == NULL)\r
+           from_addr = notmuch_config_get_user_primary_email (config);\r
\r
++      simple_from = talloc_strdup (ctx, from_addr);\r
++\r
+       from_addr = talloc_asprintf (ctx, "%s <%s>",\r
+                                    notmuch_config_get_user_name (config),\r
+                                    from_addr);\r
+@@ -496,6 +500,13 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_\r
+       g_mime_object_set_header (GMIME_OBJECT (reply),\r
+                                 "References", references);\r
\r
++      message_id = talloc_asprintf (ctx, "<%lu-notmuch-%s>",\r
++                                    time(NULL),\r
++                                    simple_from);\r
++      g_mime_object_set_header (GMIME_OBJECT (reply),\r
++                                "Message-ID", message_id);\r
++      talloc_free (simple_from);\r
++\r
+       show_reply_headers (reply);\r
\r
+       g_object_unref (G_OBJECT (reply));\r
+-- \r
+1.7.3.2\r
+\r