[PATCH v2 2/3] reply: add message-id header

Felipe Contreras felipe.contreras at gmail.com
Wed Apr 18 12:44:43 PDT 2012


On Wed, Apr 18, 2012 at 4:09 PM, Jani Nikula <jani at nikula.org> wrote:
> On Wed, 18 Apr 2012 15:39:12 +0300, Felipe Contreras <felipe.contreras at gmail.com> wrote:
>> Signed-off-by: Felipe Contreras <felipe.contreras at gmail.com>
>> ---
>>  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.

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.

-- 
Felipe Contreras


More information about the notmuch mailing list