|-R||Reject mail classified as spam|
|-D||Discard mail classified as spam|
|-t||Train bogofilter with the mail classified as spam/ham|
|-S||Use spamicity header. Read configuration file section for further details.|
|-u user||User to run the milter. Default: bogofilter|
|-s conn||Path to the pipe to connect sendmail. Default: unix:/var/spool/bogofilter/milter.sock|
|-b bogo_path||Path to the bogofilter(1) binary. Default: /usr/local/bin/bogofilter|
|If this string is found in the Subject of a message, it will be automatically accepted and no filtering operation will be done.|
|-c conf_file||Path to the configuration file. Default: /usr/local/etc/bogom.conf|
|-l body_limit||Length limit in bytes to be processed from mail body. The rest of the body will be discarded and not analyzed by the filter. Default: no limit|
|-p pidfile||Path to the file to store the pid of the milter. The pidfile is created after the milter drops privileges and the user to run the milter must have write permission to the specified file. Default: /var/spool/bogofilter/bogom.pid|
|-f forward_spam||Set a recipient to forward any message classified as spam. Read configuration file section for further details.|
|Path to a directory to deliver a copy of any message classified as spam. The messages are stored in maildir(5) format.|
|-d||Enable debug messages (implies verbose logging)|
Default policy is to add the X-Bogosity header (Yes, No, Unsure) and deliver the mail. This can be changed with -R or -D when bogofilter classifies the mail as spam.
In bogofilters configuration the bogofilter_dir token should be set to the directory with system database, usually /var/spool/bogofilter, in bogofilters configuration, or simply the words database of the unprivileged user running the milter can be used.
bogom uses a temporal file to store each individual message and forks a new process to scan it with bogofilter. This temporal file uses /tmp directory by default, its owned by the user running the milter and has 0600 mode. When a directory is specified in quarantine_mdir, the tmp subdirectory in that maildir is used as temporal directory.
The option -t registers the mail after classifying it as spam or ham. This option can be dangerous because the filter may register errors, so you should read carefully bogofilters manual regarding this point.
Milter support in sendmail binary can be verified with:
The milter can be added to sendmails configuration by adding the following lines to the mc file:
It assumes the default place for the communication socket.
The cf file must be rebuilt and sendmail restarted.
Configuration 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 wont 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 bogom process when this option is active.
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.
bogom 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 -v option, extra information will be addressed with notice level plus the log facility provided in bofogilter.
-d option enables debug level with very verbose logging.
bogom activity can be logged to a separate file with following lines in syslog.conf(5):!bogom *.* /var/log/bogom !bogofilter *.* /var/log/bogom
sendmail(8), bogofilter(1), bogoutil(1), syslog.conf(5), syslogd(8), re_format(7), maildir(5)
By now SIGHUP is ignored.
The first version of bogom was written in the end of 2004.
Juan J. Martinez <email@example.com>