Function: mh-bogofilter-blocklist
mh-bogofilter-blocklist is an autoloaded and byte-compiled function
defined in mh-junk.el.gz.
Signature
(mh-bogofilter-blocklist MSG)
Documentation
Blocklist MSG with bogofilter.
Bogofilter is a Bayesian spam filtering program. Get it from your local distribution or from the bogofilter web site at URL https://bogofilter.sourceforge.io/.
Bogofilter is taught by running:
bogofilter -n < good-message
on every good message, and
bogofilter -s < spam-message
on every spam message. This is called a full training; three other training methods are described in the FAQ that is distributed with bogofilter. Note that most Bayesian filters need 1000 to 5000 of each type of message to start doing a good job.
To use bogofilter, add the following recipes to ".procmailrc":
PATH=$PATH:/usr/bin/mh
MAILDIR=$HOME/`mhparam Path
# Fight spam with bogofilter.
:0fw
| bogofilter -3 -e -p
:0:
* ^X-Bogosity: Yes, tests=bogofilter
spam/.
:0:
* ^X-Bogosity: Unsure, tests=bogofilter
spam/unsure/.
If bogofilter classifies a message incorrectly, or is unsure, you can
use the MH-E commands M-x mh-junk-blocklist (mh-junk-blocklist) and M-x mh-junk-allowlist (mh-junk-allowlist)
to update bogofilters training.
The "Bogofilter FAQ" suggests that you run the following occasionally to shrink the database:
bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
mv wordlist.db wordlist.db.prv
mv wordlist.db.new wordlist.db
The "Bogofilter tuning HOWTO" describes how you can fine-tune Bogofilter.
Source Code
;; Defined in /usr/src/emacs/lisp/mh-e/mh-junk.el.gz
;;;###mh-autoload
(defun mh-bogofilter-blocklist (msg)
"Blocklist MSG with bogofilter.
Bogofilter is a Bayesian spam filtering program. Get it from your
local distribution or from the bogofilter web site at URL
`https://bogofilter.sourceforge.io/'.
Bogofilter is taught by running:
bogofilter -n < good-message
on every good message, and
bogofilter -s < spam-message
on every spam message. This is called a full training; three other
training methods are described in the FAQ that is distributed with
bogofilter. Note that most Bayesian filters need 1000 to 5000 of each
type of message to start doing a good job.
To use bogofilter, add the following recipes to \".procmailrc\":
PATH=$PATH:/usr/bin/mh
MAILDIR=$HOME/`mhparam Path`
# Fight spam with bogofilter.
:0fw
| bogofilter -3 -e -p
:0:
* ^X-Bogosity: Yes, tests=bogofilter
spam/.
:0:
* ^X-Bogosity: Unsure, tests=bogofilter
spam/unsure/.
If bogofilter classifies a message incorrectly, or is unsure, you can
use the MH-E commands \\[mh-junk-blocklist] and \\[mh-junk-allowlist]
to update bogofilter's training.
The \"Bogofilter FAQ\" suggests that you run the following
occasionally to shrink the database:
bogoutil -d wordlist.db | bogoutil -l wordlist.db.new
mv wordlist.db wordlist.db.prv
mv wordlist.db.new wordlist.db
The \"Bogofilter tuning HOWTO\" describes how you can fine-tune Bogofilter."
(unless mh-bogofilter-executable
(error "Unable to find the bogofilter executable"))
(message "Blocklisting message %d with bogofilter..." msg)
(let ((msg-file (mh-msg-filename msg mh-current-folder)))
(mh-truncate-log-buffer)
;; Put call-process output in log buffer if we are saving it
;; (this happens if mh-junk-background is t).
(with-current-buffer mh-log-buffer
(call-process mh-bogofilter-executable msg-file mh-junk-background
nil "-s")
(message "Blocklisting message %d with bogofilter...done" msg))))