Function: spam-check-ifile

spam-check-ifile is a byte-compiled function defined in spam.el.gz.

Signature

(spam-check-ifile)

Documentation

Check the ifile backend for the classification of this message.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/spam.el.gz
(defun spam-check-ifile ()
  "Check the ifile backend for the classification of this message."
  (let ((article-buffer-name (buffer-name))
        category return)
    (with-temp-buffer
      (let ((temp-buffer-name (buffer-name))
            (db-param (spam-get-ifile-database-parameter)))
        (with-current-buffer article-buffer-name
          (apply #'call-process-region
                 (point-min) (point-max) spam-ifile-program
                 nil temp-buffer-name nil "-c"
                 (if db-param `(,db-param "-q") '("-q"))))
        ;; check the return now (we're back in the temp buffer)
        (goto-char (point-min))
        (if (not (eobp))
            (setq category (buffer-substring (point) (line-end-position))))
        (when (not (zerop (length category))) ; we need a category here
          (if spam-ifile-all-categories
              (setq return category)
            ;; else, if spam-ifile-all-categories is not set...
            (when (string-equal spam-ifile-spam-category category)
              (setq return spam-split-group)))))) ; note return is nil otherwise
    return))