/usr/share/crm114/classifymail.crm is in crm114 20100106-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #! /usr/bin/crm
#
# classifymail.crm - a quick classify only
# Copyright 2009 William S. Yerazunis.
# This file is under GPLv3, as described in COPYING.
# this ISOLATE will guarantee that :fileprefix: exists, and keep it's
# prior (commandline) value if it does, and an empty string if it doesnt
isolate (:fileprefix:)
# This is the code to read the per-user configuration. Note
# that because this happens during the run, it will _override_
# any comand line arguments that get set.
{
isolate (:option_txt:)
isolate (:ev:)
isolate (:verbose_startup:)
# read in the mail filter configuration file.
input [:*:fileprefix:mailfilter.cf] (:option_txt:)
# output /options == :*:option_txt:\n/
# reset loop for matching to start of :option_txt:
match [:option_txt:] //
# and loop till there are no more options.
{
# find a line that looks like a parameter setting...
match < fromend nomultiline > (:line: :name: :value:) \
[:option_txt:] /^([[:graph:]]+).*\/(.*)\/.*$/
{
# don't execute the assign if there's a # at the start of the line.
match <absent> [:name:] /^\x23/
{
# debugging print
match [:verbose_startup:] /SET/
output / :*:name:\n :*:value:\n/
}
isolate (:*:name:) /:*:value:/
}
liaf
}
}
# now do the actual work
{
# match (:data:) /.*/
match (:data:) [:_dw: 0 :*:decision_length:] /.*/
isolate (:stats:)
{
classify [:data:] <:*:clf:> ( :*:fileprefix:nonspam.css | :*:fileprefix:spam.css ) (:stats:) /:*:lcr:/
output / file nonspam.css matches better \n:*:stats::*:_nl:/
exit /0/
}
output / file spam.css matches better \n:*:stats::*:_nl:/
exit /1/
}
|