+\f
+
+;; Bogofilter Interface
+
+(defvar mh-bogofilter-executable (executable-find "bogofilter"))
+
+;;;###mh-autoload
+(defun mh-bogofilter-blacklist (msg)
+ "Blacklist MSG with bogofilter.
+
+Bogofilter is a Bayesian spam filtering program. Get it from your
+local distribution or from http://bogofilter.sourceforge.net/.
+
+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-blacklist] and \\[mh-junk-whitelist]
+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"))
+ (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"))))
+
+;;;###mh-autoload
+(defun mh-bogofilter-whitelist (msg)
+ "Whitelist MSG with bogofilter.
+
+See `mh-bogofilter-blacklist' for more information."
+ (unless mh-bogofilter-executable
+ (error "Unable to find the bogofilter executable"))
+ (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 "-n"))))
+
+\f
+
+;; Spamprobe Interface
+
+(defvar mh-spamprobe-executable (executable-find "spamprobe"))
+
+;;;###mh-autoload
+(defun mh-spamprobe-blacklist (msg)
+ "Blacklist MSG with SpamProbe.
+
+SpamProbe is a Bayesian spam filtering program. Get it from your local
+distribution or from http://spamprobe.sourceforge.net.
+
+To use SpamProbe, add the following recipes to \".procmailrc\":
+
+ PATH=$PATH:/usr/bin/mh
+ MAILDIR=$HOME/`mhparam Path`
+
+ # Fight spam with SpamProbe.
+ :0
+ SCORE=| spamprobe receive
+
+ :0 wf
+ | formail -I \"X-SpamProbe: $SCORE\"
+
+ :0:
+ *^X-SpamProbe: SPAM
+ spam/.
+
+If SpamProbe classifies a message incorrectly, you can use the
+MH-E commands \\[mh-junk-blacklist] and \\[mh-junk-whitelist] to
+update SpamProbe's training."
+ (unless mh-spamprobe-executable
+ (error "Unable to find the spamprobe executable"))
+ (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-spamprobe-executable msg-file mh-junk-background
+ nil "spam"))))
+
+;;;###mh-autoload
+(defun mh-spamprobe-whitelist (msg)
+ "Whitelist MSG with SpamProbe.
+
+See `mh-spamprobe-blacklist' for more information."
+ (unless mh-spamprobe-executable
+ (error "Unable to find the spamprobe executable"))
+ (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-spamprobe-executable msg-file mh-junk-background
+ nil "good"))))
+