--- /dev/null
+Return-Path: <david@tethera.net>\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 DDFBF6DE0B20\r
+ for <notmuch@notmuchmail.org>; Sat, 13 Jun 2015 14:16:41 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.194\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.194 tagged_above=-999 required=5 tests=[AWL=0.194]\r
+ 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 Sgk8VshFkXji for <notmuch@notmuchmail.org>;\r
+ Sat, 13 Jun 2015 14:16:40 -0700 (PDT)\r
+Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
+ [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id EB0A96DE0948\r
+ for <notmuch@notmuchmail.org>; Sat, 13 Jun 2015 14:16:39 -0700 (PDT)\r
+Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
+ 4.80) (envelope-from <david@tethera.net>)\r
+ id 1Z3slk-0008In-Cu; Sat, 13 Jun 2015 21:15:12 +0000\r
+Received: (nullmailer pid 12039 invoked by uid 1000); Sat, 13 Jun 2015\r
+ 21:14:54 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Xu Wang <xuwang762@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: search query "replytoid:<blah>"\r
+In-Reply-To:\r
+ <CAJhTkNhYew6H-bptACTew3gN3DLWg6agTYu8hAkdwFS=z4VFWg@mail.gmail.com>\r
+References:\r
+ <CAJhTkNhYew6H-bptACTew3gN3DLWg6agTYu8hAkdwFS=z4VFWg@mail.gmail.com>\r
+User-Agent: Notmuch/0.20.1+21~g4e79903 (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sat, 13 Jun 2015 23:14:54 +0200\r
+Message-ID: <877fr79upd.fsf@maritornes.cs.unb.ca>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Sat, 13 Jun 2015 21:16:42 -0000\r
+\r
+Xu Wang <xuwang762@gmail.com> writes:\r
+\r
+> Dear all,\r
+>\r
+> Is it possible to search based on which message ID a message\r
+> *responds* to? For example, suppose message id is MESSAGEID. I want to\r
+> find all emails that responded to MESSAGEID. How to enter such a query\r
+> into notmuch?\r
+\r
+Threads aren't exactly the concept you ask for, because the include the\r
+messages before the message-id in question as well. Nonetheless, maybe\r
+the following helps:\r
+\r
+\r
+% notmuch show $(notmuch search --output=threads $MESAGEID)\r
+\r
+or\r
+\r
+% notmuch search --output=messages $(notmuch search --output=threads $MESAGEID)\r