[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Say you want to add a new back end called blackbox. For filtering incoming mail, provide the following:
(defvar spam-use-blackbox nil "True if blackbox should be used.") |
Add
(spam-use-blackbox . spam-check-blackbox) |
spam-list-of-checks
.
Write the spam-check-blackbox
function. It should return
`nil' or spam-split-group
. See the existing
spam-check-*
functions for examples of what you can do.
Make sure to add spam-use-blackbox
to
spam-list-of-statistical-checks
if Blackbox is a statistical
mail analyzer that needs the full message body to operate.
For processing spam and ham messages, provide the following:
Note you don't have to provide a spam or a ham processor. Only provide them if Blackbox supports spam or ham processing.
(defvar gnus-group-spam-exit-processor-blackbox "blackbox" "The Blackbox summary exit spam processor. Only applicable to spam groups.") (defvar gnus-group-ham-exit-processor-blackbox "blackbox" "The whitelist summary exit ham processor. Only applicable to non-spam (unclassified and ham) groups.") |
(defun spam-blackbox-register-spam-routine () (spam-generic-register-routine ;; the spam function (lambda (article) (let ((from (spam-fetch-field-from-fast article))) (when (stringp from) (blackbox-do-something-with-this-spammer from)))) ;; the ham function nil)) (defun spam-blackbox-register-ham-routine () (spam-generic-register-routine ;; the spam function nil ;; the ham function (lambda (article) (let ((from (spam-fetch-field-from-fast article))) (when (stringp from) (blackbox-do-something-with-this-ham-sender from)))))) |
Write the blackbox-do-something-with-this-ham-sender
and
blackbox-do-something-with-this-spammer
functions. You can add
more complex code than fetching the message sender, but keep in mind
that retrieving the whole message takes significantly longer than the
sender through spam-fetch-field-from-fast
, because the message
senders are kept in memory by Gnus.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |