From: Felipe Contreras Date: Wed, 18 Apr 2012 12:39:12 +0000 (+0300) Subject: [PATCH v2 2/3] reply: add message-id header X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=e786140531e61b76a8006f8dd4ee012846fad28e;p=notmuch-archives.git [PATCH v2 2/3] reply: add message-id header --- diff --git a/75/85dd19b54dda728229a2c27ae50c12f90f2567 b/75/85dd19b54dda728229a2c27ae50c12f90f2567 new file mode 100644 index 000000000..f01446bc2 --- /dev/null +++ b/75/85dd19b54dda728229a2c27ae50c12f90f2567 @@ -0,0 +1,105 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1E5AD431FC2 + for ; Wed, 18 Apr 2012 05:39:53 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id vSIOvoPHC1mM for ; + Wed, 18 Apr 2012 05:39:51 -0700 (PDT) +Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com + [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 21A90431FC4 + for ; Wed, 18 Apr 2012 05:39:44 -0700 (PDT) +Received: by mail-lpp01m010-f53.google.com with SMTP id c1so5790633lah.26 + for ; Wed, 18 Apr 2012 05:39:44 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=3csTSfLduuyKsm+XwcS3qTH472ZHkBu1QSCvNnWiWzg=; + b=KXIxQwY1DDVs74Pxgn4n822M3K4WsUlxkrIHbidb87/Odd4g7x9vnYhefGIVcWDqZT + F6sir0qHXbiRjE5VVz8oRAtKJTbZops0DYuk0kFcjdGFl3AmRxEj5oyPI/2mJgH4nLVo + mQvwdZgkSAB1HZk0D5lYDeB0FurDQgn2WefGSH+9JzR0TcBRXbZ0Vi3aVSmmS6QsOPtM + yqXAsak32dvls47NxCcH6IkJWg8pCcu9ntWNgqGq3DjOOep/vIrNmjcy1AzXvXNYGKmA + soZGnfvxfZHpvPKOuC9jnZhWxNWk7TYEPNUgzqHS+20HT4ZZyCbXD+wsPUZf2Lbi2RlX + l08A== +Received: by 10.152.146.39 with SMTP id sz7mr2037980lab.3.1334752784827; + Wed, 18 Apr 2012 05:39:44 -0700 (PDT) +Received: from localhost (85-156-70-103.elisa-mobile.fi. [85.156.70.103]) + by mx.google.com with ESMTPS id ay4sm32964881lbb.2.2012.04.18.05.39.43 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 18 Apr 2012 05:39:44 -0700 (PDT) +From: Felipe Contreras +To: notmuch@notmuchmail.org +Subject: [PATCH v2 2/3] reply: add message-id header +Date: Wed, 18 Apr 2012 15:39:12 +0300 +Message-Id: <1334752753-23970-3-git-send-email-felipe.contreras@gmail.com> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: <1334752753-23970-1-git-send-email-felipe.contreras@gmail.com> +References: <1334752753-23970-1-git-send-email-felipe.contreras@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 18 Apr 2012 12:39:53 -0000 + +Signed-off-by: Felipe Contreras +--- + notmuch-reply.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/notmuch-reply.c b/notmuch-reply.c +index 0949d9f..d796bb2 100644 +--- a/notmuch-reply.c ++++ b/notmuch-reply.c +@@ -464,6 +464,8 @@ create_reply_message(void *ctx, + { + const char *subject, *from_addr = NULL; + const char *in_reply_to, *orig_references, *references; ++ const char *message_id; ++ char *simple_from; + + /* The 1 means we want headers in a "pretty" order. */ + GMimeMessage *reply = g_mime_message_new (1); +@@ -488,6 +490,8 @@ create_reply_message(void *ctx, + if (from_addr == NULL) + from_addr = notmuch_config_get_user_primary_email (config); + ++ simple_from = talloc_strdup (ctx, from_addr); ++ + from_addr = talloc_asprintf (ctx, "%s <%s>", + notmuch_config_get_user_name (config), + from_addr); +@@ -508,6 +512,13 @@ create_reply_message(void *ctx, + g_mime_object_set_header (GMIME_OBJECT (reply), + "References", references); + ++ message_id = talloc_asprintf (ctx, "<%lu-notmuch-%s>", ++ time(NULL), ++ simple_from); ++ g_mime_object_set_header (GMIME_OBJECT (reply), ++ "Message-ID", message_id); ++ talloc_free (simple_from); ++ + return reply; + } + +-- +1.7.10 +