]> git.madduck.net Git - etc/mailfilter.git/blob - crm114/mailfilter.cf

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge branch 'master' of ssh://git.madduck.net/~/git/pub/etc/mailfilter
[etc/mailfilter.git] / crm114 / mailfilter.cf
1 #  mailfilter.cf  -- Config file for mailfilter, mailreaver, mailtrainer
2 #  
3 #    You MUST edit the fileds for "Secret Password", "mime decoder", and
4 #    "cache_dupe_command".  Just those THREE things.  
5 #
6 #     Changes to all other values are optional.
7 #
8 #    Many of the options here have two or three alternatives; for your
9 #     convenience, we have put all of the reasonable alternatives 
10 #      on sequential lines.  Uncomment the one you want, and leave the
11 #       others commented out.  If you leave more than one uncommented, the
12 #       last one is the one that's used.  Don't do that; it's ugly.
13 #
14 #   After you edit this file, don't forget to edit 'rewrites.mfp' 
15
16 #     --------->>>  You MUST set the following correctly! <<<-------
17 #
18 #    If you leave it as "DEFAULT-PASSWORD", you will not be able to 
19 #    access the mail-to-myself commanding system, as "DEFAULT-PASSWORD"
20 #    is specifically _disabled_ as a legal password.  Just pick something, eh?
21 #
22 :spw: /DEFAULT_PASSWORD/
23
24 # ----- If you want a verbose startup, turn this on.  Note that this is
25 #  ----- intentionally _after_ the password is set, so a verbose startup
26 #   ----- will not reveal your password.  
27 #
28 #:verbose_startup: /SET/
29 :verbose_startup: //
30
31 #
32 #     --------->>>  You MUST set the following correctly! <<<-------
33 #
34 #     --- Some mail systems do mime decoding with "mimencode -d" or "-u".
35 #     --- Others (such as Red Hat 8.0) use "mewdecode" .
36 #     --- Yet others (such as Fedora Core 3) use "openssl base64 -d" .
37 #     --- Yet Others (i.e. *BSDs) can use "base64" .
38 #     --- See which one is on your system and use that one- comment
39 #     --- the others out.  If you can't figure out what your base64 mime
40 #     --- decoder is, or don't want mime decoding, set :do_base64: to /no/
41 #     --- but expect a significant accuracy decrease if you do this.
42 #
43 #:do_base64: /no/
44 :do_base64: /yes/
45 #
46 #:mime_decoder: /mewdecode/
47 #:mime_decoder: /mimencode -d/
48 #:mime_decoder: /mimencode -u/
49 #:mime_decoder: /base64 -d/
50 :mime_decoder: /openssl base64 -d/
51 #:mime_decoder: /normalizemime/
52
53
54 #     --------->>>  You MUST set the following correctly! <<<-------
55 #
56 #    --- Linux (and Unix) systems use "hardlinks" to make a file 
57 #    --- appear in more than one place, while not actually using up 
58 #    --- extra disk space.  Sadly, it is the case that most 
59 #    --- Windows systems have no such feature.  So, you must set the
60 #    --- following for what kind of system you are actually using.
61 #    --  Note to other developers: here's where to put other system-dependent
62 #    --  syscall commands.
63 #
64 #    --- Use the default /ln/ for LINUX and UNIX systems (does a hard-link,
65 #    --- does not use up disk space or inodes).  Change this to the /copy/
66 #    --- command for WINDOWS systems (95, 98, NT, XP)
67 #
68 #    --- Mild security issue: to avoid a theoretical exploit where a user
69 #    --- gets their commands re-aliased, make sure you use the fully qualified
70 #    --- commandname (that is, starting in the root directory).
71 #
72 :cache_dupe_command: /\/bin\/ln/
73 #:cache_dupe_command: /copy/
74
75
76
77 ###########################################################################
78 #
79 #                END of things you absolutely MUST set.  Feel free
80 #            to keep reading though...
81 #
82 ###########################################################################
83
84 ###########################################################################
85 #
86 #             START of things you might likely want to set.  These 
87 #            are probably OK for you, but many users change these things.
88 #
89 ##########################################################################
90           
91 #  ----------- define an optional target for where to send spam,  
92 #   ----------- To NOT forward this to another account, just leave the
93 #    ----------- address as the empty string, which is '//'.
94 #     ----------- This works fine especially if your mail reader program
95 #      ----------- can sort based on the ADV and UNS (or whatever you choose
96 #       ----------- to use as flagging strings) in the "Subject:" field.
97 #     ------- CAUTION- some systems are buggy and _REQUIRE_ a user@host.domain
98 #    ----- in the following to forward spammy mail correctly.  WTF??? :-(
99 #
100 #:general_fails_to: /somebody@somewhere.net/
101 :general_fails_to: //
102
103
104 #   -------- If you would prefer to send specific kinds of spam to 
105 #    -------- different mailboxes, here's where to do it.
106 #     ----------(be sure to uncomment the line!)
107 #
108 # :fail_priority_mail_to:  /where_priority_fails_go/
109 # :fail_blacklist_mail_to:  /where_blacklist_fails_go/
110 # :fail_SSM_mail_to:  /where_Classifier_fails_go_for_mailFILTER/
111 # :fail_classify_mail_to: /where_classifier_fails_go_for_mailREAVER/
112
113
114 #  ---------  Do we give nonspam, spam, and unsure an exitcode of 0 
115 #  ---------    (for most standalone apps) or something else?
116 #  ---------     Usually we use an exit code of 1 for "program fault",
117 #  ---------      but change it if you need to use 0/1 for good/spam 
118 #  ---------       Don't use an exit code greater than 128 (it breaks BASH!)
119 #  ---------     If you use exit codes (procmail doesn't) change it here.
120 :rejected_mail_exit_code: /0/
121 :accepted_mail_exit_code: /0/
122 :unsure_mail_exit_code: /0/
123 :program_fault_exit_code: /1/
124
125 #######################################################################
126 #
127 #         END of things you are likely to want to change.  
128 #
129 #         Anything following is starting to approach true customization.
130 #        Feel free to explore and poke around.
131 ######################################################################
132
133 # -----------Do we want to add the optional headers to the mail?
134 # -----------If turned on, will add X-CRM114-Whatever: headers on each
135 # -----------incoming email.  (note- this does NOT turn off the cache-id header
136 #
137 :add_headers: /yes/
138 #:add_headers: /no/
139
140
141 # ---------  do we add the statistics report?
142 :add_verbose_stats: /no/
143 #:add_verbose_stats: /no/
144
145
146 # ---------  do we add the mailtrainer report to the top of the message body
147 # ---------  after training?
148 :add_mailtrainer_report: /no/
149 #:add_mailtrainer_report: /no/
150
151
152 #  ---------  Do we enable long-form explains (with lots of text)?
153 #  -- you can have no extra stuff, add it as text, or add it as an attachment.
154 #  -- (only available in mailfilter, not mailreaver)
155 #
156 :add_extra_stuff: /no/
157 # :add_extra_stuff: /text/
158 # :add_extra_stuff: /attachment/
159
160
161 #  ---------  Do we prevent crm114 from adding multiple sfid tags?
162 #  -- every time mailreaver or mailfilter process a message, they add an sfid
163 #  -- tag to the Message-Id field, even if such a tag already exists.
164 #  -- by setting the following, crm114 knows not to add the tag if one already
165 #  -- exists.
166 #
167 :unique_sfid: /SET/
168
169
170 #  ---------  Do we want to insert a "flagging" string on the subject line, 
171 #  ---------  perhaps to insert an 'ADV:'  ?  Whatever string we put here
172 #  ---------  will be inserted at the front of the subject if we think the
173 #  ---------  mail is spam.
174 #
175 # :spam_flag_subject_string: //
176 :spam_flag_subject_string: //
177
178 #  ---------  Do we want to insert a "flagging" string on the subject line
179 #  ---------  for good email?  Usually we don't.... so we set this to the
180 #  ---------  null string - that is, //
181 :good_flag_subject_string: //
182
183 #  ------------Similarly, do we want to insert a "flagging" string on 
184 #  -------------the subject line of an "unsure" email?  This way we know
185 #  --------------we need to train it even if "headers" is turned off.
186 # :unsure_flag_subject_string: //
187 :unsure_flag_subject_string: //
188
189 # ------------- Do we want Training ConFirmation flags on the results of
190 # ------------- a message to be learned?  Default is "TCF:".
191 :confirm_flag_subject_string: //
192 #:confirm_flag_subject_string: //
193
194
195 # ---------  Do we want to do any "rewrites" to increase generality and
196 #  ---------- (usually) accuracy?  IF 'yes', be sure to edit rewrites.mfp!
197 #    --------- NOTE: this option is somewhat slow.  If your mailserver is
198 #      --------- maxed out on CPU, you might want to turn this off.
199 #
200 :rewrites_enabled: /yes/
201 #:rewrites_enabled: /no/
202
203
204 #  ---------  Do we copy incoming text into allmail.txt ?  default is yes, but
205 #   ---------  experienced users will probably set this to 'no' after testing
206 #    ---------  their configuration for functionality.
207 #
208 :log_to_allmail.txt:  /no/
209 # :log_to_allmail.txt: /no/
210
211 #   -------  Another logging option - log all mail to somewhere else
212 #    -------  entirely.  Whatever pathname is given here will be prefixed
213 #     -------  by :fileprefix: 
214 #      -------  To not use this, set it to the null string .. //   
215 #       -------  Remember to backslash-escape path slashes!
216 :log_all_mail_to_file: //
217 #:log_all_mail_to_file: /my_personal_mail_log_file_name.txt/
218
219 #
220 #     ---------- Message Cacheing for retraining - do we keep a cache of
221 #    ---------- messages we've classified recently "in the wild" as retrain
222 #   ---------- texts?  This uses up some disk space, but means that we can
223 #  ---------- use mailtrainer.crm on these messages to autotune the classifier.
224 # ---------- Default is to cache into the directory reaver_cache ; 
225 #  ---------- if you don't want this, set it to // .  If you don't use this,
226 #   ---------- you can't really use mailtrainer.crm, and you must keep your
227 #    ---------- headers scrupulously clean in all train messages.  Recommended
228 #     ---------- to leave this unchanged unless you are VERY short of disk.
229 #
230 :text_cache: /../../../.var/crm114/reaver_cache/
231 # :text_cache: //
232
233
234 #   ----- How do we invoke the trainer (as in, just the invocation 
235 #   ------ of CRM114 on mailtrainer.crm.  Usually this is just obvious,
236 #   ------- but if you don't have CRM114 installed in the search path, here's
237 #   -------- where you can set trainer invocation to be via whatever path
238 #   --------- you want it (the second example is if you haven't installed
239 #   ---------- CRM114 at all, but are running the crm114_tre static binary
240 #   ----------- right out of the local directory.)
241 #      
242 #     -- use this next one if you have installed CRM114 with "make install"
243 #     -- (This is preferred and is the default)
244 :trainer_invoke_command: /\/usr\/share\/crm114\/mailtrainer.crm/
245 #
246 #     -- use this one if you can't do a "make install" and so must run the
247 #     --- crm114_tre binary directly out of the current working directory.
248 # :trainer_invoke_command: /.\/crm114_tre mailtrainer.crm /
249
250
251 #    ------  If we're cacheing for retraining, we're probably using
252 #     ------  mailtrainer.crm or some other variant.  In that case,
253 #      ------  you will want a "randomizer" to present the training
254 #       ------  examples to the classifier in some random but balanced order.
255 #        ------  You have two choices - you can either use the "sort"
256 #         ------  command on some random character in the filename (this
257 #          ------  is NOT recommended) or use the "shuffle.crm" program.
258 #           ------  We _strongly_ recommend using shuffle.crm; the default
259 #            ------  options to shuffle.crm will work fine.  Alternatively,
260 #             ------  you can use the "sort --key 1.2" on date-named files to
261 #              -----   achieve chronological training
262 :trainer_randomizer_command: / .\/shuffle.crm /
263 #:trainer_randomizer_command: / .\/crm114_tre shuffle.crm /
264 #:trainer_randomizer_command: /sort --key 1.2/
265
266
267 #  ---------  Do we log rejected mail to a file?  default yes, but most
268 #   ---------  users should set this to no after testing their 
269 #    ---------  configuration to verify that rejected mail goes to the 
270 #     ---------  reject address.  Only works in mailfilter.crm
271 #
272 :log_rejections: /yes/
273 #:log_rejections: /no/
274
275 #  ------- alternate rejection logging - set this pathname to non-null
276 #   ------  to log rejections elsewhere.  Only for mailreaver.crm.
277 #    -----   Set to NULL ( // ) to turn this off.
278 :log_rejections_to_file: //
279 #:log_rejections_to_file /this_is_my_rejected_email_log_file.txt/
280  
281
282 #   ----------Do we want to enable "inoculation by email"?
283 #   --------(leave this off unless you want RFC inoculations)
284 #
285 :inoculations_enabled: /no/
286 #:inoculations_enabled: /yes/
287
288
289 #  --------- How many characters of the input do we really trust to be 
290 #  ---------- worthy of classification?  Usually the first few thousand
291 #  ----------- bytes of the message tell more than enough (though we've 
292 #  ------------ been "noticed" by spammers, who are now packing 4K of 
293 #  ------------- innocuous text into their headers.  No problemo... :) )
294 #
295 #:decision_length: /4096/
296 #:decision_length: /64000/
297 :decision_length: /16000/
298 #  -----  for entropy users ONLY - 4K is plenty!
299 #:decision_length: /4096/
300
301
302
303 #  ------------ Do we want to expand URLs (that is, fetching the contents
304 #  ------------- of a URL and inserting that after the url itself?)
305 #  -------------- By default this is off, but turn it on if you want
306 #  --------------- to experiment.  
307 :expand_urls: /no/
308 # :expand_urls: /yes/
309 #                 
310 #         WGET options - 30-second timeout, output to stdout. 
311 #         HACK - use the proper --user-agent="IEblahblah" for max effect!
312 :url_fetch_cmd:  /wget -T 30 -O -  /
313 #         and trim the URL text to not more than 16bytes of text.
314 :url_trim_cmd:  / head -c 16000 /
315
316
317 #######################################################################
318 #
319 #   -------------------  YOU REALLY SHOULD STOP HERE -------------------
320 #   ---------  values below this line are usually OK for almost all 
321 #   ---------  users to use unchanged - Gurus only beyond this point.
322 #
323 #######################################################################
324 #
325 #   If you want to change things here, go ahead, but realize you are
326 #   playing with things that can really hurt accuracy.  
327 #
328 #   This being open source, if you don't *think* about changing it,
329 #   what would be the use of it being open source?  That said, this
330 #   _is_ open source- you break it, you get to keep _both_ pieces!
331 #
332 #
333 #   ------------ CLF - The Classifier Flags ----------
334 #
335 #   ---------  Which classifier flags do we use?  Default for 20060101 has 
336 #   ---------  been changed to OSB UNIQUE MICROGROOM.  
337 #
338 #   ---------  A null setting gets you straight Markovian, without
339 #   ---------  microgrooming.   OSB uses less memory, is faster,
340 #   ---------  and is usually more accurate.  Correlative matching is 
341 #   ---------  100x - 1000x slower, but can match anything (binaries,
342 #   ---------  wide chars, unicode, virii, _anything_.  Winnow is a
343 #   ---------  non-statistical learning classificer with very nice 
344 #   ---------  accuracy (up to 2x SBPH).  Hyperspace is a pseudogaussian
345 #   ---------  KNN (K-nearest-neighbor) matcher.
346 #
347 #   ---------  This is also where we set whether to use microgrooming
348 #   ---------  or Arne optimization (they're currently mutually exclusive).
349 #   ---------  If you turn off microgrooming you get Arne optimization
350 #   ---------  automatically.
351 #
352 #   ---------  If you _change_ this, you _must_ empty out your .css or
353 #   ---------  .cow files and build fresh ones, because these
354 #   ---------  classifiers do NOT use compatible data storage formats!
355 #
356 #:clf: /microgroom/
357 #:clf: /osb/
358 #:clf: /osb microgroom/
359 :clf: /osb unique microgroom/
360 #:clf: /correlate/
361 #:clf: /winnow/
362 #:clf: /osbf/
363 #:clf: /osbf microgroom/
364 #:clf: /hyperspace/
365 #:clf: /hyperspace unique/
366 #
367 #
368 #
369
370 # --------- If you are using thick-threshold training of any sort,
371 # ---------- (for OSBF or otherwise) put the threshold here.
372 # ----------- Remember, the polarity of the thick threshold value
373 # ------------ is that anything scoring less than this value
374 # ------------- should be considered a trainable error, and it "flips over"
375 # -------------- so that both good mail and spam have the right symmetrical
376 # ---------------- polarity.
377
378 #     ------ a very small thick threshold (or zero!) works for Markovian.
379 #:thick_threshold: /0/
380 #:thick_threshold: /.001/
381 #     ----- a thick threshold of 5 to 20 seems good for OSB, OSBF, 
382 #     Hyperspace, Bit-Entropy, and Winnow
383 #:thick_threshold: /5.0/
384 :thick_threshold: /10.0/
385 #:thick_threshold: /20.0/
386 #
387
388 #   ---- What regex do we use for LEARN/CLASSIFY?  the first is the
389 #   ---- "old standard".  Other ones are handy for different spam
390 #   ---- mixes.  The last one is for people who get a great deal of
391 #   ---- packed HTML spam, which is almost everybody in 2003, so it
392 #   ---- used to be the default.  But since spammers have shifted away
393 #   ---- from this, it isn't the default any longer.  IF you change
394 #   ---- this, you MUST rebuild your .css files with roughly equal
395 #   ---- amounts of locally-grown spam and nonspam ( if you've been
396 #   ---- following instructions and using the "reaver" cache, this is
397 #   ---- easily done! )
398 #
399 :lcr: /[[:graph:]]+/
400 #:lcr: /[[:alnum:]]+/
401 #:lcr: /[-.,:[:alnum:]]+/
402 #:lcr: /[[:graph:]][-[:alnum:]]*[[:graph:]]?/
403 #:lcr: /[[:graph:]][-.,:[:alnum:]]*[[:graph:]]?/
404 #
405 #  this next one is pretty incomprehensible, and probably wrong...
406 #:lcr: /[[:print:]][/!?\#]?[-[[:alnum:]][[:punct:]]]*(?:[*'=;]|/?>|:/*)?
407 #
408 #
409 #     Expansions for antispamming.  You almost _always_ want these on,
410 #     unless you're debugging something really bizarre.
411
412 #  ---------  Do we enable spammus interruptus undo?  
413 :undo_interruptus: /no/
414 #:undo_interruptus: /yes/
415 #
416 #
417 #
418 # ------------ HIGHLY EXPERIMENTAL - automatic training!
419 #             enable this only if you really want to live VERY dangerously!
420 #              "Do you feel lucky today, punk?  Well, do ya?"
421 #
422 :automatic_training: /no/
423 #
424 #       ---- if you are living dangerously and have turned on autotraining,
425 #            you should also set the following to point to an address that
426 #            will get read on a quick basis, becuause this is where autotrain
427 #            verifications will go.
428
429 #:autotrain_address: /root/
430
431
432 :datadir: /..\/..\/.var\/.crm114/