]> mj.ucw.cz Git - mailman-filter.git/blob - README
Packaging scripts by MJ
[mailman-filter.git] / README
1 Mailman custom filter plugin.
2 (c) 2011 Jan Moskyto Matejka <moskyto@atrey.karlin.mff.cuni.cz>
3
4 == Description ==
5 This plugin runs your custom script for each message passed in. Your custom
6 script should
7 - return 0 if the message is to be passed through
8 - return 1 if the message is to be hold for moderation
9 - return 2 if the message is to be discarded
10
11 Your script should also provide the reason message for the moderator (or into
12 the 'vette' log file) and the rejection message for the sender.
13
14 The script gets the message on its stdin terminated by EOF. It shall read whole
15 the message before writing anything to output, otherwise deadlock is possible.
16 It shall write the reason message on stdout delimited by a line with at least
17 four = and nothing else: ===== is a delimiter, ==x==x== isn't a delimiter.
18
19 Example:
20 The script returns
21 Lorem ipsum
22 Dolor sit
23 amet.
24 =====
25 Est consectetur
26 Adipiscing
27 elit.
28 =====
29
30 The reason message is
31 Lorem ipsum
32 Dolor sit
33 amet.
34
35 The rejection message is
36 Est consectetur
37 Adipiscing
38 elit.
39
40 == Usage ==
41 Put Filter.py into the Mailman's handler directory, mostly it is
42 /usr/lib/mailman/Mailman/Handlers/.
43
44 Create your own script wherever you want. It must have the executable bit set
45 for the user who runs the list (mostly `list'). It must be also readable for
46 that user, obviously. It may be also binary if you want.
47
48 Edit your mm_cfg.py (mostly in /etc/mailman) -- append this:
49 GLOBAL_PIPELINE.insert(1, 'Filter')
50 GLOBAL_FILTER_COMMAND = "/path/to/your/custom/filter/script"
51
52 You may also put the provided (or any other) simple `filter' script into
53 /var/lib/mailman/scripts/ as this is its default location hard-coded into
54 Filter.py.
55
56 Restart Mailman.
57
58 == Known bugs ==
59 On moderation, Mailman in version 2.1.14 sends not the rejection message to
60 the sender, but the reason message. It is not a bug of this plugin, it is a bug
61 of Mailman. It may occur also in other versions. Patch for 2.1.14 included --
62 apply on /usr/lib/mailman/Mailman/Handlers/Hold.py (or similar) and don't
63 forget to recompile Hold.pyc (pycompile) and restart Mailman.
64
65 == License ==
66 This program is free software; you can redistribute it and/or
67 modify it under the terms of the GNU General Public License
68 as published by the Free Software Foundation; either version 2
69 of the License, or (at your option) any later version.
70
71 This program is distributed in the hope that it will be useful,
72 but WITHOUT ANY WARRANTY; without even the implied warranty of
73 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
74 GNU General Public License for more details.
75
76 You should have received a copy of the GNU General Public License
77 along with this program; if not, write to the Free Software 
78 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US