* spam.el (spam-verify-bogofilter): new function
(spam-check-bogofilter)
(spam-bogofilter-register-with-bogofilter): use it
+ (spam-verify-bogofilter): small fixes
2004-09-28 Simon Josefsson <jas@extundo.com>
(const :tag "Bogofilter is not installed"))
:group 'spam-bogofilter)
+(defvar spam-bogofilter-valid 'unknown "Is the bogofilter version valid?")
+
(defcustom spam-bogofilter-header "X-Bogosity"
"The header that Bogofilter inserts in messages."
:type 'string
(defun spam-verify-bogofilter ()
"Verify the Bogofilter version is sufficient."
- (when (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\."
- (shell-command-to-string
- (format "%s -sV" spam-bogofilter-path)))))
-
+ (when (eq spam-bogofilter-valid 'never)
+ (setq spam-bogofilter-valid
+ (not (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\."
+ (shell-command-to-string
+ (format "%s -sV" spam-bogofilter-path))))))
+ spam-bogofilter-valid)
+
(defun spam-check-bogofilter (&optional score)
"Check the Bogofilter backend for the classification of this message."
(if (spam-verify-bogofilter)