Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / d9 / a4dd5485522b291ec42cc41e57155b6056c00a
1 Return-Path: <fatkasuvayu+linux@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id 89D856DE0948\r
6  for <notmuch@notmuchmail.org>; Sun, 14 Jun 2015 01:23:05 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.719\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.719 tagged_above=-999 required=5 tests=[AWL=0.101,\r
12   DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001,\r
13  RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01,\r
14  SPF_PASS=-0.001] autolearn=disabled\r
15 Received: from arlo.cworth.org ([127.0.0.1])\r
16  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
17  with ESMTP id FXr0_ULYeyxE for <notmuch@notmuchmail.org>;\r
18  Sun, 14 Jun 2015 01:23:02 -0700 (PDT)\r
19 Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com\r
20  [209.85.212.169])\r
21  by arlo.cworth.org (Postfix) with ESMTPS id 7C5EA6DE0350\r
22  for <notmuch@notmuchmail.org>; Sun, 14 Jun 2015 01:23:02 -0700 (PDT)\r
23 Received: by wiwd19 with SMTP id d19so49862995wiw.0\r
24  for <notmuch@notmuchmail.org>; Sun, 14 Jun 2015 01:23:01 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
26  h=sender:date:from:to:subject:message-id:mail-followup-to:references\r
27  :mime-version:content-type:content-disposition:in-reply-to\r
28  :user-agent; bh=6B7Nso2ovim6IS0lINlo+NjPFjMJKDAjZArAkwnMCj8=;\r
29  b=cUGiGZKCeXgEdV80zH9YbQ5+87Ani8QcIwnMv2KJ34lTQuyAkvGQgH07ZZDqeAppb8\r
30  jxcvO7FLMYi4tKQOOSAUpM+z/ftKGa+Duyfuptt87znPW8jCK4QJ61lVbVWzw3UcOIOD\r
31  ArI6ONbdJ4iWqu+XwHWbcNCo/bAT+m7czMIEBg7kaktyn0E1qvImmRlH+joXMBH0eWrZ\r
32  0QxEtEIBKU9i82QP+9dUFt607jq2Lx2L2X6yFESZz7bUoVXOLoENc21TL1z8+whOd6Q1\r
33  MNfTIRPM1qflsgq3Bjv7wVD3Rzx5qpVp9qsVDOexvrZpKjCIv55gIZiJGdrksulZgNgt\r
34  nRLw==\r
35 X-Received: by 10.180.75.8 with SMTP id y8mr21493125wiv.31.1434270181013;\r
36  Sun, 14 Jun 2015 01:23:01 -0700 (PDT)\r
37 Received: from chitra.no-ip.org (ip82-139-115-46.lijbrandt.net.\r
38  [82.139.115.46])\r
39  by mx.google.com with ESMTPSA id ul1sm13539890wjc.30.2015.06.14.01.22.59\r
40  for <notmuch@notmuchmail.org>\r
41  (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
42  Sun, 14 Jun 2015 01:23:00 -0700 (PDT)\r
43 Sender: Suvayu Ali <fatkasuvayu@gmail.com>\r
44 Date: Sun, 14 Jun 2015 10:22:58 +0200\r
45 From: Suvayu Ali <fatkasuvayu+linux@gmail.com>\r
46 To: notmuch@notmuchmail.org\r
47 Subject: Re: search query "replytoid:<blah>"\r
48 Message-ID: <20150614082258.GD17381@chitra.no-ip.org>\r
49 Mail-Followup-To: notmuch@notmuchmail.org\r
50 References:\r
51  <CAJhTkNhYew6H-bptACTew3gN3DLWg6agTYu8hAkdwFS=z4VFWg@mail.gmail.com>\r
52  <20150613205552.GC17381@chitra.no-ip.org>\r
53 MIME-Version: 1.0\r
54 Content-Type: multipart/mixed; boundary="FCuugMFkClbJLl1L"\r
55 Content-Disposition: inline\r
56 In-Reply-To: <20150613205552.GC17381@chitra.no-ip.org>\r
57 User-Agent: Mutt/1.5.23.1 (2014-03-12)\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.18\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62  <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Sun, 14 Jun 2015 08:23:05 -0000\r
71 \r
72 \r
73 --FCuugMFkClbJLl1L\r
74 Content-Type: text/plain; charset=us-ascii\r
75 Content-Disposition: inline\r
76 \r
77 On Sat, Jun 13, 2015 at 10:55:52PM +0200, Suvayu Ali wrote:\r
78 > On Sat, Jun 13, 2015 at 02:47:00PM -0400, Xu Wang wrote:\r
79 > > \r
80 > > Is it possible to search based on which message ID a message\r
81 > > *responds* to? For example, suppose message id is MESSAGEID. I want to\r
82 > > find all emails that responded to MESSAGEID. How to enter such a query\r
83 > > into notmuch?\r
84\r
85 > AFAIK, this is not possible.  Notmuch does not allow searching special\r
86 > headers.  You could probably write a script using the threads output\r
87 > format to get the thread, and then use formail to find the responses.\r
88 \r
89 Try the attached script.  It accepts notmuch queries by message id.\r
90 E.g. to get the responses to your OP, you can do:\r
91 \r
92   $ ./nm-ack id:CAJhTkNhYew6H-bptACTew3gN3DLWg6agTYu8hAkdwFS=z4VFWg@mail.gmail.com\r
93   id:877fr79upd.fsf@maritornes.cs.unb.ca id:20150613205552.GC17381@chitra.no-ip.org\r
94 \r
95 The first one is David's response, the second one is mine.\r
96 \r
97 Hope this helps,\r
98 \r
99 -- \r
100 Suvayu\r
101 \r
102 Open source is the future. It sets us free.\r
103 \r
104 --FCuugMFkClbJLl1L\r
105 Content-Type: text/plain; charset=us-ascii\r
106 Content-Disposition: attachment; filename=nm-ack\r
107 \r
108 #!/bin/bash\r
109 \r
110 # Return responses to message id query\r
111 #\r
112 # $ nm-ack id:msgid@domain\r
113 # id:response1@domain1 id:response2@domain2 ...\r
114 #\r
115 # Author: Suvayu Ali\r
116 \r
117 # debug\r
118 # set -o xtrace\r
119 \r
120 declare query="$1" thread=$(notmuch search --output=threads -- "$1")\r
121 declare -a msgs=$(notmuch search --output=messages -- "$thread") responses\r
122 \r
123 function strip_mid() {\r
124     sed -e 's/[<> ]//g'\r
125 }\r
126 \r
127 for m in ${msgs[@]}; do\r
128     [[ $query == $m ]] && continue\r
129     r=id:$(notmuch show --format=raw -- $m | formail -x In-Reply-To: | strip_mid)\r
130     [[ $query == $r ]] && responses+=($m)\r
131 done\r
132 \r
133 echo ${responses[@]}\r
134 \r
135 --FCuugMFkClbJLl1L--\r