From: Felipe Contreras Date: Wed, 18 Apr 2012 12:39:13 +0000 (+0300) Subject: [PATCH v2 3/3] reply: add user-agent field X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=ef21d88f3a42c0aa40a145d34992bd0b3862c409;p=notmuch-archives.git [PATCH v2 3/3] reply: add user-agent field --- diff --git a/6e/917b40214dac2b8697bad862bba3ee3ae3a221 b/6e/917b40214dac2b8697bad862bba3ee3ae3a221 new file mode 100644 index 000000000..7ec158e0e --- /dev/null +++ b/6e/917b40214dac2b8697bad862bba3ee3ae3a221 @@ -0,0 +1,102 @@ +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 9BC5E431FC2 + for ; Wed, 18 Apr 2012 05:39:54 -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 9GtYZ5ekjjM3 for ; + Wed, 18 Apr 2012 05:39:53 -0700 (PDT) +Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com + [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 5D336431FC7 + for ; Wed, 18 Apr 2012 05:39:47 -0700 (PDT) +Received: by mail-lb0-f181.google.com with SMTP id b5so2794488lbd.26 + for ; Wed, 18 Apr 2012 05:39:47 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=wlhKJ4+LN3M62W/+etfkZLNapOFAQoDYxwhPtAYKrdY=; + b=QKrzCf53AxV7tdbRS+FmJQBYKIqbGdmjW4/EcTvCPmuqdMc+xknBZpdYMEgiI8a7kR + qr7maahP6y9OcGFzYIMoJHhzQ5qpKt8Nu4HUYMBs74S5tusQks11wBlR0EdtgNUEB/vx + yk38pzCoo1C7XJRmfahZvigKSWkR93BnIUtCf0TBVeOimDuJ6ad9Za8avxNsQJfwys1r + ca8+oqEk6/BIpgUMDApD7s4zn0rPgvrddLI/LuZkt54gOqPjVrJslAjEjPYfdB1u45bW + tJg0fRO9/3N+/iNUE/VOXwB4Ej5ebbmZO0arUFMSuHRUnA+pKUJMXl27xoJeGNNcXSxb + v47w== +Received: by 10.152.131.74 with SMTP id ok10mr1990978lab.17.1334752787075; + Wed, 18 Apr 2012 05:39:47 -0700 (PDT) +Received: from localhost (85-156-70-103.elisa-mobile.fi. [85.156.70.103]) + by mx.google.com with ESMTPS id py12sm26194886lab.4.2012.04.18.05.39.45 + (version=TLSv1/SSLv3 cipher=OTHER); + Wed, 18 Apr 2012 05:39:46 -0700 (PDT) +From: Felipe Contreras +To: notmuch@notmuchmail.org +Subject: [PATCH v2 3/3] reply: add user-agent field +Date: Wed, 18 Apr 2012 15:39:13 +0300 +Message-Id: <1334752753-23970-4-git-send-email-felipe.contreras@gmail.com> +X-Mailer: git-send-email 1.7.10 +In-Reply-To: <1334752753-23970-1-git-send-email-felipe.contreras@gmail.com> +References: <1334752753-23970-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: Wed, 18 Apr 2012 12:39:54 -0000 + +Signed-off-by: Felipe Contreras +--- + notmuch-reply.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/notmuch-reply.c b/notmuch-reply.c +index d796bb2..22838d5 100644 +--- a/notmuch-reply.c ++++ b/notmuch-reply.c +@@ -464,7 +464,7 @@ create_reply_message(void *ctx, + { + const char *subject, *from_addr = NULL; + const char *in_reply_to, *orig_references, *references; +- const char *message_id; ++ const char *message_id, *user_agent; + char *simple_from; + + /* The 1 means we want headers in a "pretty" order. */ +@@ -512,6 +512,7 @@ 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); +@@ -519,6 +520,11 @@ create_reply_message(void *ctx, + "Message-ID", message_id); + talloc_free (simple_from); + ++ user_agent = talloc_asprintf (ctx, "notmuch %s", ++ STRINGIFY(NOTMUCH_VERSION)); ++ g_mime_object_set_header (GMIME_OBJECT (reply), ++ "User-Agent", user_agent); ++ + return reply; + } + +-- +1.7.10 +