--- /dev/null
+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 1E5AD431FC2\r
+ for <notmuch@notmuchmail.org>; Wed, 18 Apr 2012 05:39:53 -0700 (PDT)\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 vSIOvoPHC1mM for <notmuch@notmuchmail.org>;\r
+ Wed, 18 Apr 2012 05:39:51 -0700 (PDT)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+ [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 21A90431FC4\r
+ for <notmuch@notmuchmail.org>; Wed, 18 Apr 2012 05:39:44 -0700 (PDT)\r
+Received: by mail-lpp01m010-f53.google.com with SMTP id c1so5790633lah.26\r
+ for <notmuch@notmuchmail.org>; Wed, 18 Apr 2012 05:39:44 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+ bh=3csTSfLduuyKsm+XwcS3qTH472ZHkBu1QSCvNnWiWzg=;\r
+ b=KXIxQwY1DDVs74Pxgn4n822M3K4WsUlxkrIHbidb87/Odd4g7x9vnYhefGIVcWDqZT\r
+ F6sir0qHXbiRjE5VVz8oRAtKJTbZops0DYuk0kFcjdGFl3AmRxEj5oyPI/2mJgH4nLVo\r
+ mQvwdZgkSAB1HZk0D5lYDeB0FurDQgn2WefGSH+9JzR0TcBRXbZ0Vi3aVSmmS6QsOPtM\r
+ yqXAsak32dvls47NxCcH6IkJWg8pCcu9ntWNgqGq3DjOOep/vIrNmjcy1AzXvXNYGKmA\r
+ soZGnfvxfZHpvPKOuC9jnZhWxNWk7TYEPNUgzqHS+20HT4ZZyCbXD+wsPUZf2Lbi2RlX\r
+ l08A==\r
+Received: by 10.152.146.39 with SMTP id sz7mr2037980lab.3.1334752784827;\r
+ Wed, 18 Apr 2012 05:39:44 -0700 (PDT)\r
+Received: from localhost (85-156-70-103.elisa-mobile.fi. [85.156.70.103])\r
+ by mx.google.com with ESMTPS id ay4sm32964881lbb.2.2012.04.18.05.39.43\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Wed, 18 Apr 2012 05:39:44 -0700 (PDT)\r
+From: Felipe Contreras <felipe.contreras@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 2/3] reply: add message-id header\r
+Date: Wed, 18 Apr 2012 15:39:12 +0300\r
+Message-Id: <1334752753-23970-3-git-send-email-felipe.contreras@gmail.com>\r
+X-Mailer: git-send-email 1.7.10\r
+In-Reply-To: <1334752753-23970-1-git-send-email-felipe.contreras@gmail.com>\r
+References: <1334752753-23970-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: Wed, 18 Apr 2012 12:39:53 -0000\r
+\r
+Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\r
+---\r
+ notmuch-reply.c | 11 +++++++++++\r
+ 1 file changed, 11 insertions(+)\r
+\r
+diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+index 0949d9f..d796bb2 100644\r
+--- a/notmuch-reply.c\r
++++ b/notmuch-reply.c\r
+@@ -464,6 +464,8 @@ create_reply_message(void *ctx,\r
+ {\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
+ /* The 1 means we want headers in a "pretty" order. */\r
+ GMimeMessage *reply = g_mime_message_new (1);\r
+@@ -488,6 +490,8 @@ create_reply_message(void *ctx,\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
+@@ -508,6 +512,13 @@ create_reply_message(void *ctx,\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
+ return reply;\r
+ }\r
+ \r
+-- \r
+1.7.10\r
+\r