--- /dev/null
+Return-Path: <amdragon@mit.edu>\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 4A988431FBD\r
+ for <notmuch@notmuchmail.org>; Mon, 14 Jul 2014 06:04:42 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[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 BFjEufi6-rIM for <notmuch@notmuchmail.org>;\r
+ Mon, 14 Jul 2014 06:04:37 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu\r
+ [18.7.68.35])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 6B314431FBC\r
+ for <notmuch@notmuchmail.org>; Mon, 14 Jul 2014 06:04:37 -0700 (PDT)\r
+X-AuditID: 12074423-f79bf6d000007580-1d-53c3d564ad56\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ (using TLS with cipher AES256-SHA (256/256 bits))\r
+ (Client did not present a certificate)\r
+ by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id EE.26.30080.465D3C35; Mon, 14 Jul 2014 09:04:36 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s6ED4YkN008197; \r
+ Mon, 14 Jul 2014 09:04:36 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s6ED4W5M027492\r
+ (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+ Mon, 14 Jul 2014 09:04:33 -0400\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1X6fvj-0000OI-Ti; Mon, 14 Jul 2014 09:04:32 -0400\r
+Date: Mon, 14 Jul 2014 09:04:31 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Sime Ramov <sramov@pobox.com>\r
+Subject: Re: notmuch-reply date format\r
+Message-ID: <20140714130431.GB4660@mit.edu>\r
+References: <1722345767858996112.enqueue@ouroboros.ramov.inet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1722345767858996112.enqueue@ouroboros.ramov.inet>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpgleLIzCtJLcpLzFFi42IR4hTV1k25ejjYYEOnscX1mzOZLW7+3Mrq\r
+ wOTxbNUtZo+Ll5QDmKK4bFJSczLLUov07RK4Mq5/2M9SsJSv4vK6brYGxm7uLkZODgkBE4k/\r
+ k06xQdhiEhfurQeyuTiEBGYzSRx/spYZwtnIKLH061YmkCohgdNMErPelUEkljBKHHrxjREk\r
+ wSKgKvHn6zWwUWwCGhLb9i8HinNwiAgoStxcoQoSZhaQlvj2uxlsjrCAmsS+f3fAWnkFtCWW\r
+ 9Pxig5hvJ3Hn+S02iLigxMmZT1ggerUkbvx7yQQyEmTO8n8cICangL3E14k1IBWiAioSU05u\r
+ Y5vAKDQLSfMsJM2zEJoXMDKvYpRNya3SzU3MzClOTdYtTk7My0st0jXTy80s0UtNKd3ECApo\r
+ dhflHYx/DiodYhTgYFTi4c3gOBwsxJpYVlyZe4hRkoNJSZR3+UGgEF9SfkplRmJxRnxRaU5q\r
+ 8SFGCQ5mJRHe00eBcrwpiZVVqUX5MClpDhYlcd631lbBQgLpiSWp2ampBalFMFkZDg4lCd6+\r
+ K0CNgkWp6akVaZk5JQhpJg5OkOE8QMP3gtTwFhck5hZnpkPkTzEqSonzHrgMlBAASWSU5sH1\r
+ whLOK0ZxoFeEeX+CtPMAkxVc9yugwUxAg8trwAaXJCKkpBoYy55btj+Kbr/e8Eo2tTjW/Ntd\r
+ 2R3WDBvO3S0/0LDgzlr+yJIAgSkWpeXJp7NY/jYvkJOa+6pktoPXYgZmxcbo86YRTwqWb/ws\r
+ k3hPKamMU89T6MOUMK2O2flPZr55XCR//artNfHgi3PzfohIqJ3n9VrG7b4n1v4z6/IZl3fb\r
+ z9p2x69D0TJGiaU4I9FQi7moOBEA2fszdBMDAAA=\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: Mon, 14 Jul 2014 13:04:42 -0000\r
+\r
+Quoth Sime Ramov on Jul 14 at 2:28 pm:\r
+> Hello,\r
+> \r
+> I would like to customize the attribution string in the reply templates.\r
+> Something like this, with ISO date:\r
+> \r
+> * Full Name <me@example.net> [2014-07-14 12:30 +0200]:\r
+> \r
+> After the following trivial edit:\r
+> \r
+> diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+> index 7c1c809..eaf1eed 100644\r
+> --- a/notmuch-reply.c\r
+> +++ b/notmuch-reply.c\r
+> @@ -44,9 +44,9 @@ format_part_reply (mime_node_t *node)\r
+> int i;\r
+> if (node->envelope_file) {\r
+> - printf ("On %s, %s wrote:\n",\r
+> - notmuch_message_get_header (node->envelope_file, "date"),\r
+> - notmuch_message_get_header (node->envelope_file, "from"));\r
+> + printf ("* %s [%s]:\n",\r
+> + notmuch_message_get_header (node->envelope_file, "from"),\r
+> + notmuch_message_get_header (node->envelope_file, "date"));\r
+> } else if (GMIME_IS_MESSAGE (node->part)) {\r
+> GMimeMessage *message = GMIME_MESSAGE (node->part);\r
+> InternetAddressList *recipients;\r
+> \r
+> The (partial) result is this:\r
+> \r
+> * Full Name <me@example.net> [Mon, 14 Jul 2014 12:30:36 +0200]:\r
+> \r
+> Where would be the best place to `strftime` date? I snooped around in\r
+> lib/ source but haven't gotten far. Any ideas? Is it a Xapian thing?\r
+\r
+Hi Sime.\r
+\r
+First, are you sure this is the right place to modify reply\r
+attribution? The Emacs frontend builds its own reply template. I'm\r
+not sure what the other frontends do.\r
+\r
+Assuming the CLI is the right place for you to change this, you\r
+probably want to call notmuch_message_get_date, then localtime, then\r
+strftime. The call to notmuch_message_get_header returns the literal\r
+text from the message's Date: header, while notmuch_message_get_date\r
+returns the parsed Date: header as a time_t.\r