[Patch v7 4/6] restore: transparently support gzipped input
[notmuch-archives.git] / 90 / c5f2c4d7cfed1c857c2585aebcba6bdb920972
1 Return-Path: <mvyskocil@suse.cz>\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 olra.theworths.org (Postfix) with ESMTP id 4FDDF431FB6\r
6         for <notmuch@notmuchmail.org>; Fri, 22 Mar 2013 04:56:32 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -5\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-5 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_HI=-5] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id O2-bor-GV6yR for <notmuch@notmuchmail.org>;\r
16         Fri, 22 Mar 2013 04:56:31 -0700 (PDT)\r
17 Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15])\r
18         by olra.theworths.org (Postfix) with ESMTP id 8412F431FAF\r
19         for <notmuch@notmuchmail.org>; Fri, 22 Mar 2013 04:56:31 -0700 (PDT)\r
20 Received: from relay1.suse.de (unknown [195.135.220.254])\r
21         by mx2.suse.de (Postfix) with ESMTP id 32C72A4C0E\r
22         for <notmuch@notmuchmail.org>; Fri, 22 Mar 2013 12:56:28 +0100 (CET)\r
23 Date: Fri, 22 Mar 2013 12:56:23 +0100\r
24 From: Michal Vyskocil <mvyskocil@suse.cz>\r
25 To: notmuch@notmuchmail.org\r
26 Subject: funcmail.py: generate notmuch-tags based on headers\r
27 Message-ID: <20130322115623.GA18329@linux-xtv2.site>\r
28 MIME-Version: 1.0\r
29 Content-Type: multipart/signed; micalg=pgp-sha1;\r
30         protocol="application/pgp-signature"; boundary="BOKacYhQ+x31HxR3"\r
31 Content-Disposition: inline\r
32 User-Agent: Mutt/1.5.21 (2010-09-15)\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Fri, 22 Mar 2013 11:56:32 -0000\r
46 \r
47 \r
48 --BOKacYhQ+x31HxR3\r
49 Content-Type: text/plain; charset=us-ascii\r
50 Content-Disposition: inline\r
51 \r
52 Hi,\r
53 \r
54 because it seems that notmuch does not index all headers, I've written a\r
55 simple, but quite usable tool, which goes through a maildir and generate\r
56 an output for notmuch-tag --batch according a simple rules. I've\r
57 borrowed the syntax from notmuch-tag --batch format, so it should be\r
58 very easy for any notmuch user to configure.\r
59 \r
60 You can query the content of a paricular header\r
61 # tags will be applied when string is in header\r
62 +notmuch -inbox -- 'notmuch.notmuchmail.org' in 'List-Id'\r
63 \r
64 or in more than one header\r
65 +notmuch -inbox -- 'notmuch.notmuchmail.org' in ('List-Id',\r
66 'X-Mailinglist')\r
67 \r
68 Or use the procmail-like grep, where a whole email will be searched for\r
69 a pattern.\r
70 \r
71 # procmail-like rule, the whole email is searched for a pattern\r
72 +notmuch -inbox -- 'List-Id.*notmuch.notmuchmail.org'\r
73 \r
74 Note the matchin rule is a normal Python expression, so everything\r
75 Python interpreted can evaluate, should be used. I've ever wanted to\r
76 learn about those parts of a Python, so this was a nice opportunity to\r
77 learn.\r
78 \r
79 https://gist.github.com/mvyskocil/5220690\r
80 \r
81 Regards\r
82 Michal Vyskocil\r
83 \r
84 --BOKacYhQ+x31HxR3\r
85 Content-Type: application/pgp-signature; name="signature.asc"\r
86 Content-Description: Digital signature\r
87 \r
88 -----BEGIN PGP SIGNATURE-----\r
89 Version: GnuPG v2.0.19 (GNU/Linux)\r
90 \r
91 iEYEARECAAYFAlFMRuYACgkQGwzgx2QvQgQkqACgg4h8pMh9uRXI7juOzicq2IjJ\r
92 RSQAnj8ypjW7x7sQG1gkrwKulvWS/gUA\r
93 =rkN0\r
94 -----END PGP SIGNATURE-----\r
95 \r
96 --BOKacYhQ+x31HxR3--\r