(elmo-spam-bsfilter-use-remote): New user option.
authorhmurata <hmurata>
Wed, 15 Nov 2006 02:18:29 +0000 (02:18 +0000)
committerhmurata <hmurata>
Wed, 15 Nov 2006 02:18:29 +0000 (02:18 +0000)
(elmo-spam-list-spam-messages): Check it option.

elmo/ChangeLog
elmo/elsp-bsfilter.el

index 725a3f3..ea7cc85 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-15  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * elsp-bsfilter.el (elmo-spam-bsfilter-use-remote): New user option.
+       (elmo-spam-list-spam-messages): Check it option.
+
 2006-11-08  Tetsurou Okazaki  <okazaki@be.to>
 
        * elmo-util.el (elmo-with-progress-display): Return the value
index 36bd1ad..8c1a26b 100644 (file)
   :type 'integer
   :group 'elmo-spam-bsfilter)
 
+(defcustom elmo-spam-bsfilter-use-remote
+  (and elmo-spam-bsfilter-shell-program
+       (let ((program (file-name-nondirectory
+                      elmo-spam-bsfilter-shell-program))
+            (remote-shells '("ssh" "rsh")))
+        (catch 'found
+          (dolist (shell remote-shells)
+            (when (string-match (concat "\\`" shell) program)
+              (throw 'found t)))
+          nil)))
+  "*Non-nil disables local file feature."
+  :type 'boolean
+  :group 'elmo-spam-bsfilter)
+
 (defcustom elmo-spam-bsfilter-debug nil
   "Non-nil to debug elmo bsfilter spam backend."
   :type 'boolean
 
 (luna-define-method elmo-spam-list-spam-messages :around
   ((processor elsp-bsfilter) folder &optional numbers)
-  (if (not (elmo-folder-message-file-p folder))
+  (if (or elmo-spam-bsfilter-use-remote
+         (not (elmo-folder-message-file-p folder)))
       (luna-call-next-method)
     (let* ((nth-of-targets (1- (or elmo-spam-bsfilter-max-files-per-process
                                   100)))