From: Felipe Contreras Date: Wed, 18 Apr 2012 19:44:43 +0000 (+0300) Subject: Re: [PATCH v2 2/3] reply: add message-id header X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=466ac01cdd374d10fb0e1ab5cfb2880449ad343e;p=notmuch-archives.git Re: [PATCH v2 2/3] reply: add message-id header --- diff --git a/86/12b4553c2a79af44e052f16336d95da5289ec4 b/86/12b4553c2a79af44e052f16336d95da5289ec4 new file mode 100644 index 000000000..c81301929 --- /dev/null +++ b/86/12b4553c2a79af44e052f16336d95da5289ec4 @@ -0,0 +1,121 @@ +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 D9C6B431FB6 + for ; Wed, 18 Apr 2012 12:44:50 -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 0F5j6bNZWZ2N for ; + Wed, 18 Apr 2012 12:44:46 -0700 (PDT) +Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com + [209.85.215.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8E4CB431FAE + for ; Wed, 18 Apr 2012 12:44:46 -0700 (PDT) +Received: by eaa1 with SMTP id 1so3172616eaa.26 + for ; Wed, 18 Apr 2012 12:44:43 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=mime-version:in-reply-to:references:date:message-id:subject:from:to + :cc:content-type:content-transfer-encoding; + bh=/QG+mVpMMlbTXah2fPcRbD/jb6xmPqz55l7VkCv8vj0=; + b=Ly1pHN7lWTEhhUVO1cM2QogM9iDihVzrHoi4dEvpDnrjskavsjC5vXoH5hqaxrLcFm + JBh5yNYeRiK9RSFPpVg3El5hot6X9hg6k/a97Wmj3RQnFZcojrqbtu8AkSg+vwJ1h3pX + O91gPuN5Q9OURtwDzBLmpgzfsKyKdhfP0qSr9f92PyCEoeKg/bn7FcOPvQRwLzqtOlkl + MWOrr1hQWk8RDgrQrPFGMnaGJgLS5TNat0a2INNnDRkhCDa+LUI4zt+f17P2JIXURd6H + CBr6IsOsCiKRZ/GetzPhRmBjlqHgj6O4/qHEESRW4yV6xEClCT2Fm1/7s8M6NcjWBGaG + lo3A== +MIME-Version: 1.0 +Received: by 10.213.6.195 with SMTP id a3mr313287eba.78.1334778283733; Wed, 18 + Apr 2012 12:44:43 -0700 (PDT) +Received: by 10.213.19.67 with HTTP; Wed, 18 Apr 2012 12:44:43 -0700 (PDT) +In-Reply-To: <87zka9b2zl.fsf@nikula.org> +References: <1334752753-23970-1-git-send-email-felipe.contreras@gmail.com> + <1334752753-23970-3-git-send-email-felipe.contreras@gmail.com> + <87zka9b2zl.fsf@nikula.org> +Date: Wed, 18 Apr 2012 22:44:43 +0300 +Message-ID: + +Subject: Re: [PATCH v2 2/3] reply: add message-id header +From: Felipe Contreras +To: Jani Nikula +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: quoted-printable +Cc: notmuch@notmuchmail.org +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 19:44:51 -0000 + +On Wed, Apr 18, 2012 at 4:09 PM, Jani Nikula wrote: +> On Wed, 18 Apr 2012 15:39:12 +0300, Felipe Contreras wrote: +>> Signed-off-by: Felipe Contreras +>> --- +>> =C2=A0notmuch-reply.c | =C2=A0 11 +++++++++++ +>> =C2=A01 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, +>> =C2=A0{ +>> =C2=A0 =C2=A0 =C2=A0const char *subject, *from_addr =3D NULL; +>> =C2=A0 =C2=A0 =C2=A0const char *in_reply_to, *orig_references, *referenc= +es; +>> + =C2=A0 =C2=A0const char *message_id; +>> + =C2=A0 =C2=A0char *simple_from; +>> +>> =C2=A0 =C2=A0 =C2=A0/* The 1 means we want headers in a "pretty" order. = +*/ +>> =C2=A0 =C2=A0 =C2=A0GMimeMessage *reply =3D g_mime_message_new (1); +>> @@ -488,6 +490,8 @@ create_reply_message(void *ctx, +>> =C2=A0 =C2=A0 =C2=A0if (from_addr =3D=3D NULL) +>> =C2=A0 =C2=A0 =C2=A0 from_addr =3D notmuch_config_get_user_primary_email= + (config); +>> +>> + =C2=A0 =C2=A0simple_from =3D talloc_strdup (ctx, from_addr); +>> + +>> =C2=A0 =C2=A0 =C2=A0from_addr =3D talloc_asprintf (ctx, "%s <%s>", +>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0notmuch_config_get_user_name (conf= +ig), +>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0from_addr); +>> @@ -508,6 +512,13 @@ create_reply_message(void *ctx, +>> =C2=A0 =C2=A0 =C2=A0g_mime_object_set_header (GMIME_OBJECT (reply), +>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = +=C2=A0 =C2=A0 =C2=A0 =C2=A0 "References", references); +>> +>> + =C2=A0 =C2=A0message_id =3D talloc_asprintf (ctx, "<%lu-notmuch-%s>", +>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 time(NULL), +>> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 simple_from); +> +> This duplicates the problem in "notmuch compose", hinting that you +> should probably have the message-id generation in one place only. + +Hopefully in the future 'notmuch reply' would be merged onto 'notmuch +compose --reply' or something. So this Message-ID code would be in one +place. + +--=20 +Felipe Contreras