Re: [PATCH v2 2/3] reply: add message-id header
authorFelipe Contreras <felipe.contreras@gmail.com>
Wed, 18 Apr 2012 19:44:43 +0000 (22:44 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:35 +0000 (09:46 -0800)
86/12b4553c2a79af44e052f16336d95da5289ec4 [new file with mode: 0644]

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