community/pipermail-archives/sup-talk/2012-03.txt (3941B) - raw
1 From ruthard.baudach@web.de Wed Mar 14 19:48:34 2012
2 From: ruthard.baudach@web.de (Ruthard Baudach)
3 Date: Wed, 14 Mar 2012 20:48:34 +0100
4 Subject: [sup-talk] attribution for forwarded mails?
5 Message-ID: <1331753835-sup-2041@prxbdc.dyndns.org>
6
7 The attribution hook can be used to change the sup standard reply line.
8 Is there any similar mechanism to change the same line of forwarded
9 mail?
10
11 Yours,
12
13 Ruthard
14
15 From matthieu.rakotojaona@gmail.com Mon Mar 26 23:18:06 2012
16 From: matthieu.rakotojaona@gmail.com (Matthieu Rakotojaona)
17 Date: Tue, 27 Mar 2012 01:18:06 +0200
18 Subject: [sup-talk] Filtering rules
19 Message-ID: <CAMiZLn2_xGr2tqTeH8JhZ3RRBY1WrNYTgF+8jxZAn1ZFvAowrg@mail.gmail.com>
20
21 Hello everyone,
22
23 I have been working on a filtering rules system for heliotrope.
24 Basically, I wanted to have something that can apply some rules to my
25 messages, so that I could rearrange my mails' labels/state
26 automatically at any given time, much like what notmuch does (speaking
27 of which : it's sad that common goals in building an efficient mail
28 system are so much separated by divergences in code).
29
30 I preferred to use an "after-add" strategy, as opposed to a
31 "before-add", for multiple reasons :
32
33 - In a "after-add", messages are already indexed; a search for a
34 matching criteria is easily done with mechanisms from whistlepig
35 (which was built for the job). In a "before-add", you would have to
36 search for your criterias manually
37 - If you put bad labels/state before adding the message to the store,
38 you have to search for it manually and apply the good ones
39 - In case of a bulk import, a bulk labelling is practical.
40
41 So I worked on a possible template for rules that is very simple. It's
42 pure yaml, and looks like this :
43
44 - to:"sup" subject:"Filtering rules" :
45 labels: "+sup"
46 - to:"me at domain.com" body:"Enlarge your" :
47 state: "+spam"
48 - from:"facebook" :
49 state: "-unread"
50
51 Again, it's very simple, but I believe it is quite readable and can do
52 most of the things one would want. You can have find more (documented)
53 examples at the previous link.
54
55 So I created a filter.rb script, in the heliotrope folder, on my
56 public repo (https://github.com/rakoo/heliotrope/tree/filter). Here's
57 how you use it :
58
59 ruby filter.rb --dir /path/to/heliotrope/data/dir --check
60 /path/to/rules/files.yml
61
62 And it will print you what are the offending threads. I didn't put the
63 changes back to the store yet for testing purposes (it's just a puts
64 of the non-matching threads), but it's just a :dry_run opt away.
65 Plus, state are to be considered differently than labels: they are
66 per-message, not per-threads.
67
68 Bonus : I guess most of us use Gmail and Gmail's filters. The same
69 script can take your gmail filters and output a valid yaml rules file
70 for you! You just have to export your rules by hand (it's a Lab
71 feature) to a local file, and run :
72
73 ruby filter.rb --dir /path/to/heliotrope/data/dir --import
74 /path/to/gmail/filters/file.xml
75
76 I have to work around a few quirks, but you can post-edit the
77 generated file easily to get a usable rules file.
78 There's a way to get your rules automagically from Google servers, but
79 it is reserved to Google Apps users. If you're a simple user, you must
80 use the export function.
81
82 I'm working on the other way around (heliotrope -> Gmail), but Gmail's
83 import/export rules are XML-the-verbose.
84
85 Please enjoy this !
86
87 Totally unrelated : I happen to have some negative thread_ids. Is it
88 an expected behaviour ?
89
90 --
91 Matthieu RAKOTOJAONA
92
93 From masterkorp@masterkorp.net Tue Mar 27 12:38:10 2012
94 From: masterkorp@masterkorp.net (Alfredo Palhares)
95 Date: Tue, 27 Mar 2012 14:38:10 +0200
96 Subject: [sup-talk] Filtering rules
97 In-Reply-To: <CAMiZLn2_xGr2tqTeH8JhZ3RRBY1WrNYTgF+8jxZAn1ZFvAowrg@mail.gmail.com>
98 References: <CAMiZLn2_xGr2tqTeH8JhZ3RRBY1WrNYTgF+8jxZAn1ZFvAowrg@mail.gmail.com>
99 Message-ID: <1332851835-sup-9298@masterkorp.net>
100
101 Thanks, i alawus wanted to try heliotrope.
102
103
104 --
105 Regards,
106 Alfredo Palhares
107