Function: spam-bogofilter-register-with-bogofilter

spam-bogofilter-register-with-bogofilter is a byte-compiled function defined in spam.el.gz.

Signature

(spam-bogofilter-register-with-bogofilter ARTICLES SPAM &optional UNREGISTER)

Documentation

Register an article, given as a string, as spam or non-spam.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/spam.el.gz
(defun spam-bogofilter-register-with-bogofilter (articles
                                                 spam
                                                 &optional unregister)
  "Register an article, given as a string, as spam or non-spam."
  (if (spam-verify-bogofilter)
      (dolist (article articles)
        (let ((article-string (spam-get-article-as-string article))
              (db spam-bogofilter-database-directory)
              (switch (if unregister
                          (if spam
                              spam-bogofilter-spam-strong-switch
                            spam-bogofilter-ham-strong-switch)
                        (if spam
                            spam-bogofilter-spam-switch
                          spam-bogofilter-ham-switch))))
          (when (stringp article-string)
            (with-temp-buffer
              (insert article-string)

              (apply #'call-process-region
                     (point-min) (point-max)
                     spam-bogofilter-program
                     nil nil nil switch
                     (if db `("-d" ,db "-v") '("-v")))))))
    (gnus-error 5 "`spam.el' doesn't support obsolete bogofilter versions")))