The main interface to using spam-stat
, are the following functions:
Called in a buffer, that buffer is considered to be a new spam mail. Use this for new mail that has not been processed before.
Called in a buffer, that buffer is considered to be a new non-spam mail. Use this for new mail that has not been processed before.
Called in a buffer, that buffer is no longer considered to be normal mail but spam. Use this to change the status of a mail that has already been processed as non-spam.
Called in a buffer, that buffer is no longer considered to be spam but normal mail. Use this to change the status of a mail that has already been processed as spam.
Save the hash table to the file. The filename used is stored in the
variable spam-stat-file
.
Load the hash table from a file. The filename used is stored in the
variable spam-stat-file
.
Return the spam score for a word.
Return the spam score for a buffer.
Use this function for fancy mail splitting. Add the rule ‘(:
spam-stat-split-fancy)’ to nnmail-split-fancy
Make sure you load the dictionary before using it. This requires the following in your ~/.gnus.el file:
(require 'spam-stat) (spam-stat-load)
Typical test will involve calls to the following functions:
Reset: (setq spam-stat (make-hash-table :test 'equal)) Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") Save table: (spam-stat-save) File size: (file-attribute-size (file-attributes spam-stat-file)) Number of words: (hash-table-count spam-stat) Test spam: (spam-stat-test-directory "~/Mail/mail/spam") Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc") Reduce table size: (spam-stat-reduce-size) Save table: (spam-stat-save) File size: (file-attribute-size (file-attributes spam-stat-file)) Number of words: (hash-table-count spam-stat) Test spam: (spam-stat-test-directory "~/Mail/mail/spam") Test non-spam: (spam-stat-test-directory "~/Mail/mail/misc")
Here is how you would create your dictionary:
Reset: (setq spam-stat (make-hash-table :test 'equal)) Learn spam: (spam-stat-process-spam-directory "~/Mail/mail/spam") Learn non-spam: (spam-stat-process-non-spam-directory "~/Mail/mail/misc") Repeat for any other non-spam group you need... Reduce table size: (spam-stat-reduce-size) Save table: (spam-stat-save)