spam-stat.el is now part of Oort Gnus, and documented in the manual.
You can get a copy of spam-stat.el here. It will work without Oort Gnus, too.
Here is the spam-stat.el quickstart: You need two nnml directories, one with spam, one with non-spam mails before you start.
‘spam-stat-save’to save the dictionary. Note that you might prefer to use (let ((coding-system-for-write ‘emacs-mule)) (spam-stat-save)) instead, else sometimes the weird coding systems from the spams will render your .spam-stat.el an invalid lisp file. But then note that if you ever chose iso-2022-jp or similar, then it will be borked on reading it next time, since mule only examines the beginning of files…
(require 'spam-stat) (spam-stat-load)
And finally, change your mail splitting following one of these examples:
(setq nnmail-split-fancy `(| (: spam-stat-split-fancy) "mail.misc"))
(setq nnmail-split-fancy `(| ("Content-Type" "text/html" "mail.spam.filtered") ("Subject" "\\bspam-stat\\b" "mail.emacs") (: spam-stat-split-fancy) "mail.misc"))
‘spam-stat-buffer-is-non-spam’will often not work and will land you into a debugger. Press C-] to get out. So, if B t doesn’t work, and a mail lands up in mail.spam, how do you disable spam-stat.el and then find out where the mail should go?
See also: SpamStatConfiguration