test
[hcoop/zz_old/ikiwiki] / SpamAssassinFilter.mdwn
1 It is possible to set up custom filters to do fancy things based on the X-Spam-Level: header. Here is NathanKennedy's .forward file. He finds that the default setting of 5.0 is too wimpy, and lets too much spam into his inbox. Virtually no ham that he gets scores less than 3.0, whereas a lot of spam scores less than 5.0, so he'd rather have anything over 3.0 go to his Junk folder. At the same time, he doesn't want to waste time, cycles, disk space or bandwidth with spam over 9.0. Most of his spam does score 9.0, and this goes straight to /dev/null (immediately disposed of) with this filter.
2
3 Finally, he has all HCoop list email go into a special HCoop folder.
4
5 Without further ado:
6
7 {{{
8 # Nathan's exim filter
9
10 logfile $home/spamlog
11
12 if $header_subject contains "[HCoop"
13 then
14 save $home/Maildir/.HCoop/
15 finish
16 endif
17
18 if
19 "${if def:h_X-Spam-Level {def}{undef}}" is "def"
20 then
21 if $h_X-Spam-Level: begins "\*\*\*\*\*\*\*\*\*"
22 then save "/dev/null" 660
23 else
24 if $h_X-Spam-Level: begins "\*\*\*"
25 then save $home/Maildir/.Junk/
26 endif
27 endif
28 finish
29 endif
30
31 if
32 "${if def:h_X-Spam-Flag {def}{undef}}" is "def"
33 then
34 save $home/Maildir/.Junk/
35 finish
36 endif
37 }}}