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 D89DB431FBD for ; Wed, 18 Apr 2012 06:09:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 l13iMvlKfhdv for ; Wed, 18 Apr 2012 06:09:53 -0700 (PDT) Received: from mail-qc0-f181.google.com (mail-qc0-f181.google.com [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id CB047431FBC for ; Wed, 18 Apr 2012 06:09:53 -0700 (PDT) Received: by qcsk26 with SMTP id k26so5587574qcs.26 for ; Wed, 18 Apr 2012 06:09:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type:x-gm-message-state; bh=b/jhujKXVpQTQt0isqAId3CzYg046PWF0BcCcgV5xFA=; b=ZWPOOQhQi4oZFR6cie+zcStBpVzvj5cLQc4LMegoFEGqWaC/JTSFdYGlqLa42sTrqN YGLl/2+TlDfmhU5P0XwuPwBJyq0HxyYXTDG5NSAlyNrLRcAj1YP+cGgMcJWi0+vQDuv3 xhuL3yLbXsD7mBWPY0D3jfTc1wUJE7u0NzEqXMq96VnOHPVbu/9gucFwTzhMO6aZy1Qt vceUhByHowkVBIcz6uLGy3NadjHpy1ybWWJqFccQciun/WWYxZ3ZaM/JNyS531aZ31FE f3H9McGRAvQEFtA5qkROUISQMcIVz82LH4PLJorOhTxFH0mdcFzDwLOqr5+08H2icJk8 gkvw== Received: by 10.229.136.203 with SMTP id s11mr820410qct.38.1334754593140; Wed, 18 Apr 2012 06:09:53 -0700 (PDT) Received: from localhost (nikula.org. [92.243.24.172]) by mx.google.com with ESMTPS id gy7sm23801649qab.22.2012.04.18.06.09.51 (version=SSLv3 cipher=OTHER); Wed, 18 Apr 2012 06:09:52 -0700 (PDT) From: Jani Nikula To: Felipe Contreras , notmuch@notmuchmail.org Subject: Re: [PATCH v2 2/3] reply: add message-id header In-Reply-To: <1334752753-23970-3-git-send-email-felipe.contreras@gmail.com> References: <1334752753-23970-1-git-send-email-felipe.contreras@gmail.com> <1334752753-23970-3-git-send-email-felipe.contreras@gmail.com> User-Agent: Notmuch/0.11.1+222~ga47a98c (http://notmuchmail.org) Emacs/23.1.1 (i686-pc-linux-gnu) Date: Wed, 18 Apr 2012 13:09:50 +0000 Message-ID: <87zka9b2zl.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gm-Message-State: ALoCoQkaBkIbSXRQRHMKNTOjjiYkzdFGUQ5gpmG1J2tNXWQFzpnkLkOcDPWAUiQtyfZ0zrHDu4mv 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 13:09:58 -0000 On Wed, 18 Apr 2012 15:39:12 +0300, Felipe Contreras wrote: > 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); This duplicates the problem in "notmuch compose", hinting that you should probably have the message-id generation in one place only. I do wonder whether the emacs ui / message mode will add a duplicate message-id rather than override this. BR, Jani. > + g_mime_object_set_header (GMIME_OBJECT (reply), > + "Message-ID", message_id); > + talloc_free (simple_from); > + > return reply; > } > > -- > 1.7.10 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch