|
NAMEbogom —
simple sendmail milter to interface bogofilter
SYNOPSIS
DESCRIPTIONThebogom plugin can be used with the milter API of
sendmail(8)
to filter mails using
bogofilter(1)
bayesian filter.
The options are as follows:
Default policy is to add the X-Bogosity header
(Yes, No, Unsure) and deliver the mail. This can be changed with
In bogofilter's configuration the bogofilter_dir token should be set to the directory with system database, usually /var/spool/bogofilter, in bogofilter's configuration, or simply the words database of the unprivileged user running the milter can be used.
The option SENDMAIL SETUPMilter support in sendmail binary can be verified with:# sendmail -d0.1 -bv root | grep MILTER
Compiled with: DNSMAP LOG MAP_REGEX MATCHGECOS MILTER
MIME7TO8 MIME8TO7
The milter can be added to sendmail's configuration by adding the following lines to the mc file: INPUT_MAIL_FILTER(`bogom',
`S=unix:/var/spool/bogofilter/milter.sock,
T=S:30s;R:1m')
It assumes the default place for the communication socket. The cf file must be rebuilt and sendmail restarted. CONFIGURATION FILEConfiguration file supports following tokens:# line comment policy (pass|reject|discard) default: policy pass reject "<text for the SMTP reply>" default: empty (sendmail default is "Command rejected") subject_tag "<text to tag the subject>" default: empty verbose (0|1) default: verbose 0 spamicity_header (0|1) default: spamicity_header 0 bogofilter "<path to bogofilter binary>" default: bogofilter "/usr/local/bin/bogofilter" training (0|1) default: training 0 body_limit <length in bytes> default: no limit user "<username to run the milter>" default: user "bogofilter" connection "<type>:<location>" default: connection "unix:/var/spool/bogofilter/milter.sock" pidfile "<path to milter pidfile>" default: pidfile "/var/spool/bogofilter/bogom.pid" exclude_string "<subject exclude string>" default: empty forward_spam "<rcpt>" default: empty quarantine_mdir "<path to maildir directory>" default: empty re_connection "<case insensitive extended re>" default: empty re_envfrom "<case insensitive extended re>" default: empty re_envrcpt "<case insensitive extended re>" default: empty Configuration takes precedence over command line. By default X-Bogosity header will use 'Yes, tests=bogofilter', 'No, tests=bogofilter' and 'Unsure, tests=bogofilter'. With spamicity_header activated, the classification of 'Ham', 'Spam' or 'Unsure' plus the value of spamicity will be used to tag the messages. subject_tag string will be prepend to message subject when it is identified as spam and policy is pass. body_limit specifies the amount of bytes (K suffix for Kilobytes and M for Megabytes) of message body that will be passed to bogofilter to be processed. This option should help busy servers but is incompatible with quarantine_mdir feature. forward_spam recipient will receive a copy of any message classified as spam when policy is pass. Notice that the original destination recipients won't be modified and general RELAY restrictions will apply. If a directory in quarantine_mdir is specified,
any message classified as spam will be delivered there in maildir format.
Neither reject nor discard policy affect this delivery, but
body_limit option is ignored. When a message is delivered,
necessary subdirectories are created (tmp and new only). Notice that tmp
subdirectory in maildir is used as temporal directory for
The re_* tokens allow to add items to connection, envfrom and envrcpt white lists. Any message with client connection (both host and hostname, if available), sender address or destination address matching the case insensitive extended regular expression (explained in re_format(7)) will be accepted and no filtering operation will be done. Those token can be used more than once and all the regular expressions will be checked. Quoted strings can use single and double quotes, using backslash to escape both characters. LOGGINGbogom sends messages to
syslogd(8)
using facility daemon and levels err, notice, info and debug.
By default only info and, when needed, err levels will be used.
With
!bogom *.* /var/log/bogom !bogofilter *.* /var/log/bogom FILES/usr/local/etc/bogom.confSEE ALSOsendmail(8), bogofilter(1), bogoutil(1), syslog.conf(5), syslogd(8), re_format(7), maildir(5)http://www.usebox.net/jjm/bogom/ CAVEATSBy now SIGHUP is ignored.HISTORYThe first version ofbogom was written in the end of
2004.
AUTHORSJuan J. Martinez ⟨jjm@usebox.net⟩
Visit the GSP FreeBSD Man Page Interface. |