summaryrefslogtreecommitdiffstats
path: root/kmail/kmail.antispamrc-HOWTO
blob: 9edcabb06313fd3ff17573baa15c32f3ea60d430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154

HOWTO for setting up a KMail antispam wizard configuration entry
================================================================

This is a HOWTO for setting up a KMail antispam wizard configuration
entry. Since this possibly is more developer related, I put this as
text file into the source SVN. Possibly some of this should go to the
user documentation.

I gathered the information from several mails and comments by Andreas
Gungl, the original developer of the antispam wizard for KMail, and
Ingo Kloecker.

When you have questions do not hesitate to ask me, Martin Steigerwald, 
Andreas or Ingo.


Basics
------

The configuration file for the KMail antispam wizard "kmail.antispamrc"
consists of one entry for each spamfilter that the antispam wizard
shall support.

At the beginning of the file in the section "General" the option "tools" 
specifies the count of configured spam filters. Increase that by one 
when you add a new entry:

[General]
tools=11


A spam filter configuration entry starts with a header like this:

[Spamtool #11]


After this you place all the options for the spam filter. Please use
an ordering that is similar to the other entries in the configuration
file so that things are unified a bit.


General options
---------------

- Ident: Specifies the internal identifier for the entry

- Version: Specifies the version of the entry (FIXME what is this for?)

- Priority: Specifies the priority of the filter. This value is used to
  place faster filters before the slower ones in the selection list. If the
  user chooses the top item, he gets the fastest filter. Provider sided
  "filters" (which produce headers tough) like the GMX filter have a prio
  at about 70, they are very fast as they don't consume time on the client
  side. Since CRM114 is almost as fast it gets 65 ;-).

- VisibleName: This is the name that is presented to the user

Or:

- HeadersOnly=yes: This is used for entries where KMail should just parse
  the mail headers for the spam score display (see Razor filter and below
  for spam score display details).


Spam filter options
-------------------

These specify details about the spamfilter.

- Executable: Specifies a test whether the executable of the spamfilter
  can be started. You should provide something which can be run on the
  command line and returns [ $? -eq 0 ], i.e. it doesn't wait for any input 
  etc. It usually make sense to assume the program in the $PATH, so you
  should better avoid /usr/bin. Set executable to "echo" for provider based 
  filters.
  Example: Executable=crm -v | grep "CRM114"

- URL: URL to the homepage of the filter

- PipeFilterName: Name of the pipe-through filter used to send mails to the
  spamfilter and get them back with added spam filter headers.

- PipeCmdDetect: Command used to pipe the mail into.

- ExecCmdSpam: Command used to mark a mail as spam.

- ExecCmdHam: Command used to mark a mail as ham.

- SupportsBayes: Set to 1 if you have a spam filter that can learn. Only
  in this case KMail uses ExecCmdSpam and ExecCmdHam to let the user mark
  mail as ham or spam.


Spam detection options
----------------------

These specify how KMail shall detect whether a mail is spam, unsure or good.

- DetectionHeader: The name of the header where the spam filter puts the spam
  status of a mail into.

- DetectionPattern: The pattern the spam filter uses for marking a mail as
  spam.

- DetectionPattern2: The pattern the spam filter uses for marking a mail as
  unsure. Set "SupportsUnsure=1" when you use this.

- DetectionOnly: Don't pipe mails through the spam filter, but just use headers
  from outside, e.g. a provider based spam filter (See GMX).

- UseRegExp: Set to 1 if you need to use regular expressions in the detection
  patterns. KMail can operate faster when they are not required.

- SupportsUnsure: Set to 1 if you have a spam filter that supports
  classying mails as unsure to tell the user to train those.


Spam score display
------------------

Those regular expressions are used to extract the actual "spamicity" 
score and the threshold (i.e. the upper bound for non-spam) from 
SpamAssassin's ScoreHeader. The score and the threshold are then used 
for showing the spam status in the message header, i.e. the small 
colorbar.

You need to specify the following values:

- ScoreName: The name that will be shown in the message header.

- ScoreHeader: The message header containing the score value.

- ScoreType: The type of the score, cf. below.

- ScoreValueRegexp: A regular expression for extracting the score from 
  the ScoreHeader.

- ScoreThresholdRegexp: A regular expression for extracting the threshold 
  from the ScoreHeader; only needed for Adjusted type. Please set to 
  nothing (ScoreThresholdRegexp=) if not needed.


KMail supports the following ScoreType values:

- Bool: Simple Yes or No (Razor)

- Decimal: For probability between 0.0 and 1.0 (BogoFilter)

- Percentage: For straight percentages between 0.0 and 100.0

- Adjusted: Use this when we need to compare against a threshold
  (SpamAssasssin)