On Sat, Jun 13, 2015 at 10:55:52PM +0200, Suvayu Ali wrote: > On Sat, Jun 13, 2015 at 02:47:00PM -0400, Xu Wang wrote: > > > > Is it possible to search based on which message ID a message > > *responds* to? For example, suppose message id is MESSAGEID. I want to > > find all emails that responded to MESSAGEID. How to enter such a query > > into notmuch? > > AFAIK, this is not possible. Notmuch does not allow searching special > headers. You could probably write a script using the threads output > format to get the thread, and then use formail to find the responses. Try the attached script. It accepts notmuch queries by message id. E.g. to get the responses to your OP, you can do: $ ./nm-ack id:CAJhTkNhYew6H-bptACTew3gN3DLWg6agTYu8hAkdwFS=z4VFWg@mail.gmail.com id:877fr79upd.fsf@maritornes.cs.unb.ca id:20150613205552.GC17381@chitra.no-ip.org The first one is David's response, the second one is mine. Hope this helps, -- Suvayu Open source is the future. It sets us free.