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 A292E41A54C for ; Thu, 9 Dec 2010 14:32:57 -0800 (PST) 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 d+S88QQd0dEX for ; Thu, 9 Dec 2010 14:32:57 -0800 (PST) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by olra.theworths.org (Postfix) with ESMTP id 14110431FD0 for ; Thu, 9 Dec 2010 14:32:56 -0800 (PST) Received: by mail-bw0-f52.google.com with SMTP id 4so3710179bwz.39 for ; Thu, 09 Dec 2010 14:32:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=tgyLTsj/kUCsuggzDQyTNQN3MZD9BNxtc9TUXZf+c5c=; b=iU+wsURgDKcxombql8knNj61+l14bAlQ/PjmYTnV4i9rtjB9j8cZ/Rv3u6W6IubThv sOWqK7pxm1cMFh4frLn7mkyvnMJ1UbA8LFhlgbAwN6xRJjfHJ+j20wLpzGdu1/ajfJJm VJQEVzjMJBr4i830N7JPyh0mrper1q94PdT4M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=RyrlCYhRXK/mKYzf3LbyANRrLWrxS2IYyo9dRGUAU7ovLxhm+U+XnvPyJmiBNDWrF7 99s/rElhNn55Nx8k0TQxSMmc3L4oTm3kP0TYcJdJxOsVUDCFlIv/y3b9YhU5l+cwIPhu 19CWlxRICsmHm4Esoo99FDvbKT2CoEdUqbRkA= Received: by 10.204.46.130 with SMTP id j2mr4020128bkf.169.1291933976702; Thu, 09 Dec 2010 14:32:56 -0800 (PST) Received: from localhost (a91-153-253-80.elisa-laajakaista.fi [91.153.253.80]) by mx.google.com with ESMTPS id a17sm1220372bku.11.2010.12.09.14.32.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 09 Dec 2010 14:32:56 -0800 (PST) From: Felipe Contreras To: notmuch@notmuchmail.org Subject: [PATCH 1/3] reply: add message-id header Date: Fri, 10 Dec 2010 00:32:50 +0200 Message-Id: <1291933972-7186-2-git-send-email-felipe.contreras@gmail.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <1291933972-7186-1-git-send-email-felipe.contreras@gmail.com> References: <1291933972-7186-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: Thu, 09 Dec 2010 22:32:57 -0000 Signed-off-by: Felipe Contreras --- notmuch-reply.c | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 23d04b8..53a12c5 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -447,6 +447,8 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_ notmuch_message_t *message; const char *subject, *from_addr = NULL; const char *in_reply_to, *orig_references, *references; + const char *message_id; + char *simple_from; for (messages = notmuch_query_search_messages (query); notmuch_messages_valid (messages); @@ -476,6 +478,8 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_ 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); @@ -496,6 +500,13 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t *config, notmuch_query_ 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); + show_reply_headers (reply); g_object_unref (G_OBJECT (reply)); -- 1.7.3.2