[PATCH v2 3/3] reply: add user-agent field
authorFelipe Contreras <felipe.contreras@gmail.com>
Wed, 18 Apr 2012 12:39:13 +0000 (15:39 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:32 +0000 (09:46 -0800)
6e/917b40214dac2b8697bad862bba3ee3ae3a221 [new file with mode: 0644]

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