--- /dev/null
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 498696DE179D\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Dec 2015 13:56:11 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.532\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.532 tagged_above=-999 required=5 tests=[AWL=1.318,\r
+ RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.55] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id wLUx9rrWuFxX for <notmuch@notmuchmail.org>;\r
+ Tue, 29 Dec 2015 13:56:09 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 8798F6DE1767\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Dec 2015 13:56:09 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.7])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id CE60819F47EB\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Dec 2015 22:56:08 +0100 (CET)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10044)\r
+ with ESMTP id ksJjpyAwNyd3 for <notmuch@notmuchmail.org>;\r
+ Tue, 29 Dec 2015 22:56:07 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 4B37A19F463E\r
+ for <notmuch@notmuchmail.org>; Tue, 29 Dec 2015 22:56:07 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.86)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1aE2FS-0003zX-UJ; Tue, 29 Dec 2015 22:56:06 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] doc/reply: Clarify how reply-to header is handled\r
+Date: Tue, 29 Dec 2015 22:55:40 +0100\r
+Message-Id: <1451426140-15303-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 2.6.4\r
+In-Reply-To: <8760zgdioq.fsf@steelpick.2x.cz>\r
+References: <8760zgdioq.fsf@steelpick.2x.cz>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 29 Dec 2015 21:56:11 -0000\r
+\r
+Current documentation and comments in the code do not correspond to\r
+the actual code and tests in the test suite ("Un-munging Reply-To" in\r
+T230-reply-to-sender.sh). Fix it.\r
+---\r
+ doc/man1/notmuch-reply.rst | 6 ++++--\r
+ notmuch-reply.c | 2 +-\r
+ 2 files changed, 5 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/doc/man1/notmuch-reply.rst b/doc/man1/notmuch-reply.rst\r
+index cfbd4ea..d73f8f1 100644\r
+--- a/doc/man1/notmuch-reply.rst\r
++++ b/doc/man1/notmuch-reply.rst\r
+@@ -13,8 +13,10 @@ DESCRIPTION\r
+ Constructs a reply template for a set of messages.\r
+ \r
+ To make replying to email easier, **notmuch reply** takes an existing\r
+-set of messages and constructs a suitable mail template. The Reply-to:\r
+-header (if any, otherwise From:) is used for the To: address. Unless\r
++set of messages and constructs a suitable mail template. Its To:\r
++address is set according to the original email in this way: if the\r
++Reply-to: header is present and different from any To:/Cc: address it\r
++is used, otherwise From: header is used. Unless\r
+ ``--reply-to=sender`` is specified, values from the To: and Cc: headers\r
+ are copied, but not including any of the current user's email addresses\r
+ (as configured in primary\_mail or other\_email in the .notmuch-config\r
+diff --git a/notmuch-reply.c b/notmuch-reply.c\r
+index 6df54fc..3c6d685 100644\r
+--- a/notmuch-reply.c\r
++++ b/notmuch-reply.c\r
+@@ -332,7 +332,7 @@ add_recipients_from_message (GMimeMessage *reply,\r
+ * field and use the From header. This ensures the original sender\r
+ * will get the reply even if not subscribed to the list. Note\r
+ * that the address in the Reply-To header will always appear in\r
+- * the reply.\r
++ * the reply if reply_all is true.\r
+ */\r
+ if (reply_to_header_is_redundant (message)) {\r
+ reply_to_map[0].header = "from";\r
+-- \r
+2.6.4\r
+\r