aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/ChangeLog23
-rw-r--r--lisp/gnus/spam.el188
2 files changed, 112 insertions, 99 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 26e551d1ad7..a48a277df05 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,18 @@
12007-11-22 Juanma Barranquero <lekktu@gmail.com>
2
3 * spam.el (spam-find-spam, spam-enter-list): Doc fixes.
4 (spam-split-symbolic-return-positive): Reflow docstring.
5 (spam-backends, spam-summary-exit-behavior)
6 (spam-mark-ham-unread-before-move-from-spam-group)
7 (spam-summary-score-preferred-header, spam-sa-learn-spam-switch)
8 (spam-sa-learn-ham-switch, spam-sa-learn-unregister-switch)
9 (spam-clear-cache, spam-backend-check, spam-install-backend)
10 (spam-install-statistical-backend, spam-list-of-processors)
11 (spam-group-processor-p, spam-split, spam-bogofilter-score)
12 (spam-bsfilter-score, spam-check-bsfilter, spam-crm114-score)
13 (spam-check-crm114, spam-initialize, spam-unload-hook):
14 Fix typos in docstrings.
15
12007-11-21 Reiner Steib <Reiner.Steib@gmx.de> 162007-11-21 Reiner Steib <Reiner.Steib@gmx.de>
2 17
3 * message.el (message-send-mail-function): Require sendmail. 18 * message.el (message-send-mail-function): Require sendmail.
@@ -10491,7 +10506,7 @@
10491 eval-when-compile, to define gnus-agent-set-cat-groups as the setf 10506 eval-when-compile, to define gnus-agent-set-cat-groups as the setf
10492 method of gnus-agent-cat-groups even when the buffer has been 10507 method of gnus-agent-cat-groups even when the buffer has been
10493 evaled. 10508 evaled.
10494 (gnus-agent-save-active,gnus-agent-save-active-1): Merged to 10509 (gnus-agent-save-active, gnus-agent-save-active-1): Merged to
10495 delete gnus-agent-save-active-1. 10510 delete gnus-agent-save-active-1.
10496 (gnus-agent-save-groups): Deleted. Identical to 10511 (gnus-agent-save-groups): Deleted. Identical to
10497 gnus-agent-save-active. 10512 gnus-agent-save-active.
@@ -10502,12 +10517,12 @@
10502 servers. Add use of min/max range limits from server's local 10517 servers. Add use of min/max range limits from server's local
10503 file. 10518 file.
10504 (gnus-agent-save-alist): Removed unused optional argument. 10519 (gnus-agent-save-alist): Removed unused optional argument.
10505 (gnus-agent-load-local,gnus-agent-read-and-cache-local), 10520 (gnus-agent-load-local, gnus-agent-read-and-cache-local),
10506 (gnus-agent-read-local,gnus-agent-save-local,gnus-agent-get-local), 10521 (gnus-agent-read-local, gnus-agent-save-local, gnus-agent-get-local),
10507 (gnus-agent-set-local): A per-server file that keeps min/max range 10522 (gnus-agent-set-local): A per-server file that keeps min/max range
10508 limits for articles known to the agent. Provides a fast mechanism 10523 limits for articles known to the agent. Provides a fast mechanism
10509 for altering many active ranges. 10524 for altering many active ranges.
10510 (gnus-agent-expire-group,gnus-agent-expire): No longer save the 10525 (gnus-agent-expire-group, gnus-agent-expire): No longer save the
10511 active file (local makes it unnecessary). 10526 active file (local makes it unnecessary).
10512 (gnus-agent-regenerate-group): Fixed XEmacs compatibility. 10527 (gnus-agent-regenerate-group): Fixed XEmacs compatibility.
10513 10528
diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el
index 4164d3f718b..fddebb1d290 100644
--- a/lisp/gnus/spam.el
+++ b/lisp/gnus/spam.el
@@ -81,7 +81,7 @@
81;;{{{ Main parameters. 81;;{{{ Main parameters.
82(defvar spam-backends nil 82(defvar spam-backends nil
83 "List of spam.el backends with all the pertinent data. 83 "List of spam.el backends with all the pertinent data.
84Populated by spam-install-backend-super.") 84Populated by `spam-install-backend-super'.")
85 85
86(defgroup spam nil 86(defgroup spam nil
87 "Spam configuration." 87 "Spam configuration."
@@ -91,13 +91,13 @@ Populated by spam-install-backend-super.")
91 91
92(defcustom spam-summary-exit-behavior 'default 92(defcustom spam-summary-exit-behavior 'default
93 "Exit behavior at the time of summary exit. 93 "Exit behavior at the time of summary exit.
94Note that setting the spam-use-move or spam-use-copy backends on 94Note that setting the `spam-use-move' or `spam-use-copy' backends on
95a group through group/topic parameters overrides this mechanism." 95a group through group/topic parameters overrides this mechanism."
96 :type '(choice (const 'default :tag 96 :type '(choice (const 'default :tag
97 "Move spam out of all groups. Move ham out of spam groups.") 97 "Move spam out of all groups. Move ham out of spam groups.")
98 (const 'move-all :tag 98 (const 'move-all :tag
99 "Move spam out of all groups. Move ham out of all groups.") 99 "Move spam out of all groups. Move ham out of all groups.")
100 (const 'move-none :tag 100 (const 'move-none :tag
101 "Never move spam or ham out of any groups.")) 101 "Never move spam or ham out of any groups."))
102 :group 'spam) 102 :group 'spam)
103 103
@@ -124,8 +124,7 @@ a group through group/topic parameters overrides this mechanism."
124 124
125(defcustom spam-split-symbolic-return-positive nil 125(defcustom spam-split-symbolic-return-positive nil
126 "Whether `spam-split' should ALWAYS work with symbols or group names. 126 "Whether `spam-split' should ALWAYS work with symbols or group names.
127Do not set this if you use `spam-split' in a fancy split 127Do not set this if you use `spam-split' in a fancy split method."
128 method."
129 :type 'boolean 128 :type 'boolean
130 :group 'spam) 129 :group 'spam)
131 130
@@ -139,7 +138,7 @@ without losing it to the automatic spam-marking process."
139 138
140(defcustom spam-mark-ham-unread-before-move-from-spam-group nil 139(defcustom spam-mark-ham-unread-before-move-from-spam-group nil
141 "Whether ham should be marked unread before it's moved. 140 "Whether ham should be marked unread before it's moved.
142The article is moved out of a spam group according to ham-process-destination. 141The article is moved out of a spam group according to `ham-process-destination'.
143This variable is an official entry in the international Longest Variable Name 142This variable is an official entry in the international Longest Variable Name
144Competition." 143Competition."
145 :type 'boolean 144 :type 'boolean
@@ -403,7 +402,7 @@ Only meaningful if you enable `spam-use-regex-body'."
403 :group 'spam) 402 :group 'spam)
404 403
405(defcustom spam-summary-score-preferred-header nil 404(defcustom spam-summary-score-preferred-header nil
406 "Preferred header to use for spam-summary-score." 405 "Preferred header to use for `spam-summary-score'."
407 :type '(choice :tag "Header name" 406 :type '(choice :tag "Header name"
408 (symbol :tag "SpamAssassin etc" X-Spam-Status) 407 (symbol :tag "SpamAssassin etc" X-Spam-Status)
409 (symbol :tag "Bogofilter" X-Bogosity) 408 (symbol :tag "Bogofilter" X-Bogosity)
@@ -621,17 +620,17 @@ order for SpamAssassin to recognize the new registered spam."
621 :group 'spam-spamassassin) 620 :group 'spam-spamassassin)
622 621
623(defcustom spam-sa-learn-spam-switch "--spam" 622(defcustom spam-sa-learn-spam-switch "--spam"
624 "The switch that sa-learn uses to register spam messages" 623 "The switch that sa-learn uses to register spam messages."
625 :type 'string 624 :type 'string
626 :group 'spam-spamassassin) 625 :group 'spam-spamassassin)
627 626
628(defcustom spam-sa-learn-ham-switch "--ham" 627(defcustom spam-sa-learn-ham-switch "--ham"
629 "The switch that sa-learn uses to register ham messages" 628 "The switch that sa-learn uses to register ham messages."
630 :type 'string 629 :type 'string
631 :group 'spam-spamassassin) 630 :group 'spam-spamassassin)
632 631
633(defcustom spam-sa-learn-unregister-switch "--forget" 632(defcustom spam-sa-learn-unregister-switch "--forget"
634 "The switch that sa-learn uses to unregister messages messages" 633 "The switch that sa-learn uses to unregister messages messages."
635 :type 'string 634 :type 'string
636 :group 'spam-spamassassin) 635 :group 'spam-spamassassin)
637 636
@@ -722,7 +721,7 @@ finds ham or spam.")
722;;{{{ convenience functions 721;;{{{ convenience functions
723 722
724(defun spam-clear-cache (symbol) 723(defun spam-clear-cache (symbol)
725 "Clear the spam-caches entry for a check." 724 "Clear the `spam-caches' entry for a check."
726 (remhash symbol spam-caches)) 725 (remhash symbol spam-caches))
727 726
728(defun spam-xor (a b) 727(defun spam-xor (a b)
@@ -730,7 +729,7 @@ finds ham or spam.")
730 (and (or a b) (not (and a b)))) 729 (and (or a b) (not (and a b))))
731 730
732(defun spam-set-difference (list1 list2) 731(defun spam-set-difference (list1 list2)
733 "Return a set difference of LIST1 and LIST2. 732 "Return a set difference of LIST1 and LIST2.
734When either list is nil, the other is returned." 733When either list is nil, the other is returned."
735 (if (and list1 list2) 734 (if (and list1 list2)
736 ;; we have two non-nil lists 735 ;; we have two non-nil lists
@@ -837,15 +836,14 @@ Accepts incoming CHECK, ham registration function HRF, spam
837registration function SRF, ham unregistration function HUF, spam 836registration function SRF, ham unregistration function HUF, spam
838unregistration function SUF, and an indication whether the 837unregistration function SUF, and an indication whether the
839backend is STATISTICAL." 838backend is STATISTICAL."
840
841 (setq spam-backends (add-to-list 'spam-backends backend)) 839 (setq spam-backends (add-to-list 'spam-backends backend))
842 (while properties 840 (while properties
843 (let ((property (pop properties)) 841 (let ((property (pop properties))
844 (value (pop properties))) 842 (value (pop properties)))
845 (if (spam-backend-property-valid-p property) 843 (if (spam-backend-property-valid-p property)
846 (put backend property value) 844 (put backend property value)
847 (gnus-error 845 (gnus-error
848 5 846 5
849 "spam-install-backend-super got an invalid property %s" 847 "spam-install-backend-super got an invalid property %s"
850 property))))) 848 property)))))
851 849
@@ -875,7 +873,7 @@ The value nil means that the check does not yield a decision, and
875so, that further checks are needed. The value t means that the 873so, that further checks are needed. The value t means that the
876message is definitely not spam, and that further spam checks 874message is definitely not spam, and that further spam checks
877should be inhibited. Otherwise, a mailgroup name or the symbol 875should be inhibited. Otherwise, a mailgroup name or the symbol
878'spam (depending on spam-split-symbolic-return) is returned where 876'spam (depending on `spam-split-symbolic-return') is returned where
879the mail should go, and further checks are also inhibited. The 877the mail should go, and further checks are also inhibited. The
880usual mailgroup name is the value of `spam-split-group', meaning 878usual mailgroup name is the value of `spam-split-group', meaning
881that the message is definitely a spam." 879that the message is definitely a spam."
@@ -892,7 +890,7 @@ that the message is definitely a spam."
892 (setq info (format "Backend %s has the following properties:\n" 890 (setq info (format "Backend %s has the following properties:\n"
893 backend)) 891 backend))
894 (dolist (property (spam-backend-properties)) 892 (dolist (property (spam-backend-properties))
895 (setq info (format "%s%s=%s\n" 893 (setq info (format "%s%s=%s\n"
896 info 894 info
897 property 895 property
898 (get backend property)))) 896 (get backend property))))
@@ -907,13 +905,13 @@ CLASSIFICATION is 'ham or 'spam."
907 (if (and 905 (if (and
908 (spam-classification-valid-p classification) 906 (spam-classification-valid-p classification)
909 (spam-backend-function-type-valid-p type)) 907 (spam-backend-function-type-valid-p type))
910 (let ((retrieval 908 (let ((retrieval
911 (intern 909 (intern
912 (format "spam-backend-%s-%s-function" 910 (format "spam-backend-%s-%s-function"
913 classification 911 classification
914 type)))) 912 type))))
915 (funcall retrieval backend)) 913 (funcall retrieval backend))
916 (gnus-error 914 (gnus-error
917 5 915 5
918 "%s was passed invalid backend %s, classification %s, or type %s" 916 "%s was passed invalid backend %s, classification %s, or type %s"
919 "spam-backend-function" 917 "spam-backend-function"
@@ -921,21 +919,21 @@ CLASSIFICATION is 'ham or 'spam."
921 classification 919 classification
922 type))) 920 type)))
923 921
924(defun spam-backend-article-list-property (classification 922(defun spam-backend-article-list-property (classification
925 &optional unregister) 923 &optional unregister)
926 "Property name of article list with CLASSIFICATION and UNREGISTER." 924 "Property name of article list with CLASSIFICATION and UNREGISTER."
927 (let* ((r (if unregister "unregister" "register")) 925 (let* ((r (if unregister "unregister" "register"))
928 (prop (format "%s-%s" classification r))) 926 (prop (format "%s-%s" classification r)))
929 prop)) 927 prop))
930 928
931(defun spam-backend-get-article-todo-list (backend 929(defun spam-backend-get-article-todo-list (backend
932 classification 930 classification
933 &optional unregister) 931 &optional unregister)
934 "Get the articles to be processed for BACKEND and CLASSIFICATION. 932 "Get the articles to be processed for BACKEND and CLASSIFICATION.
935With UNREGISTER, get articles to be unregistered. 933With UNREGISTER, get articles to be unregistered.
936This is a temporary storage function - nothing here persists." 934This is a temporary storage function - nothing here persists."
937 (get 935 (get
938 backend 936 backend
939 (intern (spam-backend-article-list-property classification unregister)))) 937 (intern (spam-backend-article-list-property classification unregister))))
940 938
941(defun spam-backend-put-article-todo-list (backend classification list &optional unregister) 939(defun spam-backend-put-article-todo-list (backend classification list &optional unregister)
@@ -977,7 +975,7 @@ The previous backend settings for ALIAS are erased."
977 975
978 ;; install alias with no properties at first 976 ;; install alias with no properties at first
979 (spam-install-backend-super alias) 977 (spam-install-backend-super alias)
980 978
981 (dolist (property (spam-backend-properties)) 979 (dolist (property (spam-backend-properties))
982 (put alias property (get backend property)))) 980 (put alias property (get backend property))))
983 981
@@ -991,8 +989,8 @@ Accepts ham registration function HRF, spam registration function
991SRF, ham unregistration function HUF, spam unregistration 989SRF, ham unregistration function HUF, spam unregistration
992function SUF. The backend has no incoming check and can't be 990function SUF. The backend has no incoming check and can't be
993statistical." 991statistical."
994 (spam-install-backend-super 992 (spam-install-backend-super
995 backend 993 backend
996 'hrf hrf 'srf srf 'huf huf 'suf suf 'mover t)) 994 'hrf hrf 'srf srf 'huf huf 'suf suf 'mover t))
997 995
998(defun spam-install-nocheck-backend (backend hrf srf huf suf) 996(defun spam-install-nocheck-backend (backend hrf srf huf suf)
@@ -1001,7 +999,7 @@ Accepts ham registration function HRF, spam registration function
1001SRF, ham unregistration function HUF, spam unregistration 999SRF, ham unregistration function HUF, spam unregistration
1002function SUF. The backend has no incoming check and can't be 1000function SUF. The backend has no incoming check and can't be
1003statistical (it could be, but in practice that doesn't happen)." 1001statistical (it could be, but in practice that doesn't happen)."
1004 (spam-install-backend-super 1002 (spam-install-backend-super
1005 backend 1003 backend
1006 'hrf hrf 'srf srf 'huf huf 'suf suf)) 1004 'hrf hrf 'srf srf 'huf huf 'suf suf))
1007 1005
@@ -1010,8 +1008,8 @@ statistical (it could be, but in practice that doesn't happen)."
1010Accepts incoming CHECK, ham registration function HRF, spam 1008Accepts incoming CHECK, ham registration function HRF, spam
1011registration function SRF, ham unregistration function HUF, spam 1009registration function SRF, ham unregistration function HUF, spam
1012unregistration function SUF. The backend won't be 1010unregistration function SUF. The backend won't be
1013statistical (use spam-install-statistical-backend for that)." 1011statistical (use `spam-install-statistical-backend' for that)."
1014 (spam-install-backend-super 1012 (spam-install-backend-super
1015 backend 1013 backend
1016 'check check 'hrf hrf 'srf srf 'huf huf 'suf suf)) 1014 'check check 'hrf hrf 'srf srf 'huf huf 'suf suf))
1017 1015
@@ -1020,15 +1018,15 @@ statistical (use spam-install-statistical-backend for that)."
1020Accepts incoming CHECK, ham registration function HRF, spam 1018Accepts incoming CHECK, ham registration function HRF, spam
1021registration function SRF, ham unregistration function HUF, spam 1019registration function SRF, ham unregistration function HUF, spam
1022unregistration function SUF. The backend will be 1020unregistration function SUF. The backend will be
1023statistical (use spam-install-backend for non-statistical 1021statistical (use `spam-install-backend' for non-statistical
1024backends)." 1022backends)."
1025 (spam-install-backend-super 1023 (spam-install-backend-super
1026 backend 1024 backend
1027 'check check 'statistical t 'hrf hrf 'srf srf 'huf huf 'suf suf)) 1025 'check check 'statistical t 'hrf hrf 'srf srf 'huf huf 'suf suf))
1028 1026
1029(defun spam-install-statistical-checkonly-backend (backend check) 1027(defun spam-install-statistical-checkonly-backend (backend check)
1030 "Install a statistical BACKEND than can only CHECK for spam." 1028 "Install a statistical BACKEND than can only CHECK for spam."
1031 (spam-install-backend-super 1029 (spam-install-backend-super
1032 backend 1030 backend
1033 'check check 'statistical t)) 1031 'check check 'statistical t))
1034 1032
@@ -1084,7 +1082,7 @@ backends)."
1084 nil 1082 nil
1085 nil) 1083 nil)
1086 1084
1087(spam-install-backend 'spam-use-BBDB 1085(spam-install-backend 'spam-use-BBDB
1088 'spam-check-BBDB 1086 'spam-check-BBDB
1089 'spam-BBDB-register-routine 1087 'spam-BBDB-register-routine
1090 nil 1088 nil
@@ -1128,7 +1126,7 @@ backends)."
1128 'spam-stat-unregister-ham-routine 1126 'spam-stat-unregister-ham-routine
1129 'spam-stat-unregister-spam-routine) 1127 'spam-stat-unregister-spam-routine)
1130 1128
1131(spam-install-statistical-backend 'spam-use-spamassassin 1129(spam-install-statistical-backend 'spam-use-spamassassin
1132 'spam-check-spamassassin 1130 'spam-check-spamassassin
1133 'spam-spamassassin-register-ham-routine 1131 'spam-spamassassin-register-ham-routine
1134 'spam-spamassassin-register-spam-routine 1132 'spam-spamassassin-register-spam-routine
@@ -1224,13 +1222,13 @@ Note this has to be fast."
1224With SPECIFIC-HEADER, returns only that header's score. 1222With SPECIFIC-HEADER, returns only that header's score.
1225Will not return a nil score." 1223Will not return a nil score."
1226 (let (score) 1224 (let (score)
1227 (dolist (header 1225 (dolist (header
1228 (if specific-header 1226 (if specific-header
1229 (list specific-header) 1227 (list specific-header)
1230 (spam-necessary-extra-headers))) 1228 (spam-necessary-extra-headers)))
1231 (setq score 1229 (setq score
1232 (spam-extra-header-to-number header headers)) 1230 (spam-extra-header-to-number header headers))
1233 (when score 1231 (when score
1234 (return))) 1232 (return)))
1235 (or score 0))) 1233 (or score 0)))
1236 1234
@@ -1258,7 +1256,7 @@ Will not return a nil score."
1258 (let (found) 1256 (let (found)
1259 (dolist (backend (spam-backend-list)) 1257 (dolist (backend (spam-backend-list))
1260 (when (and (spam-backend-statistical-p backend) 1258 (when (and (spam-backend-statistical-p backend)
1261 (or (symbol-value backend) 1259 (or (symbol-value backend)
1262 (memq backend force-symbols))) 1260 (memq backend force-symbols)))
1263 (setq found backend))) 1261 (setq found backend)))
1264 found)) 1262 found))
@@ -1287,14 +1285,14 @@ This list contains pairs associating the obsolete ham/spam exit
1287processor variables with a classification and a spam-use-* 1285processor variables with a classification and a spam-use-*
1288variable. When the processor variable is nil, just the 1286variable. When the processor variable is nil, just the
1289classification and spam-use-* check variable are used. This is 1287classification and spam-use-* check variable are used. This is
1290superceded by the new spam backend code, so it's only consulted 1288superseded by the new spam backend code, so it's only consulted
1291for backwards compatibility.") 1289for backwards compatibility.")
1292 1290
1293(defun spam-group-processor-p (group backend &optional classification) 1291(defun spam-group-processor-p (group backend &optional classification)
1294 "Checks if GROUP has a BACKEND with CLASSIFICATION registered. 1292 "Checks if GROUP has a BACKEND with CLASSIFICATION registered.
1295Also accepts the obsolete processors, which can be found in 1293Also accepts the obsolete processors, which can be found in
1296gnus.el and in spam-list-of-processors. In the case of mover 1294gnus.el and in spam-list-of-processors. In the case of mover
1297backends, checks the setting of spam-summary-exit-behavior in 1295backends, checks the setting of `spam-summary-exit-behavior' in
1298addition to the set values for the group." 1296addition to the set values for the group."
1299 (if (and (stringp group) 1297 (if (and (stringp group)
1300 (symbolp backend)) 1298 (symbolp backend))
@@ -1315,7 +1313,7 @@ addition to the set values for the group."
1315 ;; spam-summary-exit-behavior-logic for mover backends 1313 ;; spam-summary-exit-behavior-logic for mover backends
1316 (unless found 1314 (unless found
1317 (when (spam-backend-mover-p backend) 1315 (when (spam-backend-mover-p backend)
1318 (setq 1316 (setq
1319 found 1317 found
1320 (cond 1318 (cond
1321 ((eq spam-summary-exit-behavior 'move-all) t) 1319 ((eq spam-summary-exit-behavior 'move-all) t)
@@ -1325,7 +1323,7 @@ addition to the set values for the group."
1325 ;; move ham out of spam groups 1323 ;; move ham out of spam groups
1326 (and (eq classification 'ham) 1324 (and (eq classification 'ham)
1327 (spam-group-spam-contents-p group)))) 1325 (spam-group-spam-contents-p group))))
1328 (t (gnus-error 5 "Unknown spam-summary-exit-behavior: %s" 1326 (t (gnus-error 5 "Unknown spam-summary-exit-behavior: %s"
1329 spam-summary-exit-behavior)))))) 1327 spam-summary-exit-behavior))))))
1330 1328
1331 found)) 1329 found))
@@ -1385,8 +1383,8 @@ addition to the set values for the group."
1385 ;; call spam-register-routine with specific articles to unregister, 1383 ;; call spam-register-routine with specific articles to unregister,
1386 ;; when there are articles to unregister and the check is enabled 1384 ;; when there are articles to unregister and the check is enabled
1387 (when (and unregister-list (symbol-value backend)) 1385 (when (and unregister-list (symbol-value backend))
1388 (spam-backend-put-article-todo-list backend 1386 (spam-backend-put-article-todo-list backend
1389 classification 1387 classification
1390 unregister-list 1388 unregister-list
1391 t)))))) 1389 t))))))
1392 1390
@@ -1398,7 +1396,7 @@ addition to the set values for the group."
1398 gnus-newsgroup-name 1396 gnus-newsgroup-name
1399 backend 1397 backend
1400 classification) 1398 classification)
1401 (spam-backend-put-article-todo-list backend 1399 (spam-backend-put-article-todo-list backend
1402 classification 1400 classification
1403 (spam-list-articles 1401 (spam-list-articles
1404 gnus-newsgroup-articles 1402 gnus-newsgroup-articles
@@ -1457,11 +1455,11 @@ addition to the set values for the group."
1457 article) 1455 article)
1458 (gnus-summary-mark-article article gnus-expirable-mark)) 1456 (gnus-summary-mark-article article gnus-expirable-mark))
1459 (gnus-summary-set-process-mark article) 1457 (gnus-summary-set-process-mark article)
1460 1458
1461 (if respool ; respooling is with a "fake" group 1459 (if respool ; respooling is with a "fake" group
1462 (let ((spam-split-disabled 1460 (let ((spam-split-disabled
1463 (or spam-split-disabled 1461 (or spam-split-disabled
1464 (and (eq classification 'ham) 1462 (and (eq classification 'ham)
1465 spam-disable-spam-split-during-ham-respool)))) 1463 spam-disable-spam-split-during-ham-respool))))
1466 (gnus-message 9 "Respooling article %d with method %s" 1464 (gnus-message 9 "Respooling article %d with method %s"
1467 article respool-method) 1465 article respool-method)
@@ -1476,7 +1474,7 @@ addition to the set values for the group."
1476 (gnus-message 9 "Moving article %d to group %s" 1474 (gnus-message 9 "Moving article %d to group %s"
1477 article group) 1475 article group)
1478 (gnus-summary-move-article nil group))))) ; else move articles 1476 (gnus-summary-move-article nil group))))) ; else move articles
1479 1477
1480 ;; now delete the articles, unless a) copy is t, and there was a copy done 1478 ;; now delete the articles, unless a) copy is t, and there was a copy done
1481 ;; b) a move was done to a single group 1479 ;; b) a move was done to a single group
1482 ;; c) backend-supports-deletions is nil 1480 ;; c) backend-supports-deletions is nil
@@ -1488,33 +1486,33 @@ addition to the set values for the group."
1488 (when articles 1486 (when articles
1489 (let ((gnus-novice-user nil)) ; don't ask me if I'm sure 1487 (let ((gnus-novice-user nil)) ; don't ask me if I'm sure
1490 (gnus-summary-delete-article nil))))) 1488 (gnus-summary-delete-article nil)))))
1491 1489
1492 (gnus-summary-yank-process-mark) 1490 (gnus-summary-yank-process-mark)
1493 (length articles)))) 1491 (length articles))))
1494 1492
1495(defun spam-copy-spam-routine (articles) 1493(defun spam-copy-spam-routine (articles)
1496 (spam-copy-or-move-routine 1494 (spam-copy-or-move-routine
1497 t 1495 t
1498 (gnus-parameter-spam-process-destination gnus-newsgroup-name) 1496 (gnus-parameter-spam-process-destination gnus-newsgroup-name)
1499 articles 1497 articles
1500 'spam)) 1498 'spam))
1501 1499
1502(defun spam-move-spam-routine (articles) 1500(defun spam-move-spam-routine (articles)
1503 (spam-copy-or-move-routine 1501 (spam-copy-or-move-routine
1504 nil 1502 nil
1505 (gnus-parameter-spam-process-destination gnus-newsgroup-name) 1503 (gnus-parameter-spam-process-destination gnus-newsgroup-name)
1506 articles 1504 articles
1507 'spam)) 1505 'spam))
1508 1506
1509(defun spam-copy-ham-routine (articles) 1507(defun spam-copy-ham-routine (articles)
1510 (spam-copy-or-move-routine 1508 (spam-copy-or-move-routine
1511 t 1509 t
1512 (gnus-parameter-ham-process-destination gnus-newsgroup-name) 1510 (gnus-parameter-ham-process-destination gnus-newsgroup-name)
1513 articles 1511 articles
1514 'ham)) 1512 'ham))
1515 1513
1516(defun spam-move-ham-routine (articles) 1514(defun spam-move-ham-routine (articles)
1517 (spam-copy-or-move-routine 1515 (spam-copy-or-move-routine
1518 nil 1516 nil
1519 (gnus-parameter-ham-process-destination gnus-newsgroup-name) 1517 (gnus-parameter-ham-process-destination gnus-newsgroup-name)
1520 articles 1518 articles
@@ -1570,9 +1568,9 @@ to find it out)."
1570 ((equal field 'extra) 1568 ((equal field 'extra)
1571 (mail-header-extra data-header)) 1569 (mail-header-extra data-header))
1572 (t 1570 (t
1573 (gnus-error 1571 (gnus-error
1574 5 1572 5
1575 "spam-fetch-field-fast: unknown field %s requested" 1573 "spam-fetch-field-fast: unknown field %s requested"
1576 field) 1574 field)
1577 nil)) 1575 nil))
1578 (gnus-message 6 "Article %d has a nil data header" article))))) 1576 (gnus-message 6 "Article %d has a nil data header" article)))))
@@ -1621,7 +1619,7 @@ to find it out)."
1621This function can be used as an entry in the variable `nnmail-split-fancy', 1619This function can be used as an entry in the variable `nnmail-split-fancy',
1622for example like this: (: spam-split). It can take checks as 1620for example like this: (: spam-split). It can take checks as
1623parameters. A string as a parameter will set the 1621parameters. A string as a parameter will set the
1624spam-split-group to that string. 1622`spam-split-group' to that string.
1625 1623
1626See the Info node `(gnus)Fancy Mail Splitting' for more details." 1624See the Info node `(gnus)Fancy Mail Splitting' for more details."
1627 (interactive) 1625 (interactive)
@@ -1673,7 +1671,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1673 decision)))))))) 1671 decision))))))))
1674 1672
1675(defun spam-find-spam () 1673(defun spam-find-spam ()
1676 "This function will detect spam in the current newsgroup using spam-split." 1674 "Detect spam in the current newsgroup using `spam-split'."
1677 (interactive) 1675 (interactive)
1678 1676
1679 (let* ((group gnus-newsgroup-name) 1677 (let* ((group gnus-newsgroup-name)
@@ -1685,7 +1683,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1685 gnus-newsgroup-unseen)) 1683 gnus-newsgroup-unseen))
1686 article-cannot-be-faked) 1684 article-cannot-be-faked)
1687 1685
1688 1686
1689 (dolist (backend methods) 1687 (dolist (backend methods)
1690 (when (spam-backend-statistical-p backend) 1688 (when (spam-backend-statistical-p backend)
1691 (setq article-cannot-be-faked t) 1689 (setq article-cannot-be-faked t)
@@ -1702,10 +1700,10 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1702 (subject (spam-fetch-field-subject-fast article)) 1700 (subject (spam-fetch-field-subject-fast article))
1703 (sender (spam-fetch-field-from-fast article)) 1701 (sender (spam-fetch-field-from-fast article))
1704 registry-lookup) 1702 registry-lookup)
1705 1703
1706 (unless id 1704 (unless id
1707 (gnus-message 6 "Article %d has no message ID!" article)) 1705 (gnus-message 6 "Article %d has no message ID!" article))
1708 1706
1709 (when (and id spam-log-to-registry) 1707 (when (and id spam-log-to-registry)
1710 (setq registry-lookup (spam-log-registration-type id 'incoming)) 1708 (setq registry-lookup (spam-log-registration-type id 'incoming))
1711 (when registry-lookup 1709 (when registry-lookup
@@ -1732,12 +1730,12 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1732 (apply 'spam-split methods)))))) 1730 (apply 'spam-split methods))))))
1733 (if (equal split-return 'spam) 1731 (if (equal split-return 'spam)
1734 (gnus-summary-mark-article article gnus-spam-mark)) 1732 (gnus-summary-mark-article article gnus-spam-mark))
1735 1733
1736 (when (and id split-return spam-log-to-registry) 1734 (when (and id split-return spam-log-to-registry)
1737 (when (zerop (gnus-registry-group-count id)) 1735 (when (zerop (gnus-registry-group-count id))
1738 (gnus-registry-add-group 1736 (gnus-registry-add-group
1739 id group subject sender)) 1737 id group subject sender))
1740 1738
1741 (unless registry-lookup 1739 (unless registry-lookup
1742 (spam-log-processing-to-registry 1740 (spam-log-processing-to-registry
1743 id 1741 id
@@ -1763,11 +1761,11 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1763 (delcount 0)) 1761 (delcount 0))
1764 1762
1765 ;; clear the old lists right away 1763 ;; clear the old lists right away
1766 (spam-backend-put-article-todo-list backend 1764 (spam-backend-put-article-todo-list backend
1767 classification 1765 classification
1768 nil 1766 nil
1769 nil) 1767 nil)
1770 (spam-backend-put-article-todo-list backend 1768 (spam-backend-put-article-todo-list backend
1771 classification 1769 classification
1772 nil 1770 nil
1773 t) 1771 t)
@@ -1778,29 +1776,29 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1778 (incf delcount) 1776 (incf delcount)
1779 (setq rlist (delq article rlist)) 1777 (setq rlist (delq article rlist))
1780 (setq ulist (delq article ulist)))) 1778 (setq ulist (delq article ulist))))
1781 1779
1782 (unless (zerop delcount) 1780 (unless (zerop delcount)
1783 (gnus-message 1781 (gnus-message
1784 9 1782 9
1785 "%d messages were saved the trouble of unregistering and then registering" 1783 "%d messages were saved the trouble of unregistering and then registering"
1786 delcount)) 1784 delcount))
1787 1785
1788 ;; unregister articles 1786 ;; unregister articles
1789 (unless (zerop (length ulist)) 1787 (unless (zerop (length ulist))
1790 (let ((num (spam-unregister-routine classification backend ulist))) 1788 (let ((num (spam-unregister-routine classification backend ulist)))
1791 (when (> num 0) 1789 (when (> num 0)
1792 (gnus-message 1790 (gnus-message
1793 6 1791 6
1794 "%d %s messages were unregistered by backend %s." 1792 "%d %s messages were unregistered by backend %s."
1795 num 1793 num
1796 classification 1794 classification
1797 backend)))) 1795 backend))))
1798 1796
1799 ;; register articles 1797 ;; register articles
1800 (unless (zerop (length rlist)) 1798 (unless (zerop (length rlist))
1801 (let ((num (spam-register-routine classification backend rlist))) 1799 (let ((num (spam-register-routine classification backend rlist)))
1802 (when (> num 0) 1800 (when (> num 0)
1803 (gnus-message 1801 (gnus-message
1804 6 1802 6
1805 "%d %s messages were registered by backend %s." 1803 "%d %s messages were registered by backend %s."
1806 num 1804 num
@@ -1808,12 +1806,12 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
1808 backend))))))))) 1806 backend)))))))))
1809 1807
1810(defun spam-unregister-routine (classification 1808(defun spam-unregister-routine (classification
1811 backend 1809 backend
1812 specific-articles) 1810 specific-articles)
1813 (spam-register-routine classification backend specific-articles t)) 1811 (spam-register-routine classification backend specific-articles t))
1814 1812
1815(defun spam-register-routine (classification 1813(defun spam-register-routine (classification
1816 backend 1814 backend
1817 specific-articles 1815 specific-articles
1818 &optional unregister) 1816 &optional unregister)
1819 (when (and (spam-classification-valid-p classification) 1817 (when (and (spam-classification-valid-p classification)
@@ -2134,7 +2132,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
2134 (save-excursion 2132 (save-excursion
2135 (save-window-excursion 2133 (save-window-excursion
2136 (bbdb-records nil t) 2134 (bbdb-records nil t)
2137 (mapatoms 2135 (mapatoms
2138 (lambda (symbol) 2136 (lambda (symbol)
2139 (intern (downcase (symbol-name symbol)) bbdb-cache)) 2137 (intern (downcase (symbol-name symbol)) bbdb-cache))
2140 bbdb-hashtable)))) 2138 bbdb-hashtable))))
@@ -2311,8 +2309,8 @@ With a non-nil REMOVE, remove them."
2311 2309
2312(defun spam-enter-list (addresses file &optional remove) 2310(defun spam-enter-list (addresses file &optional remove)
2313 "Enter ADDRESSES into the given FILE. 2311 "Enter ADDRESSES into the given FILE.
2314Either the whitelist or the blacklist files can be used. With 2312Either the whitelist or the blacklist files can be used.
2315REMOVE not nil, remove the ADDRESSES." 2313With a non-nil REMOVE, remove the ADDRESSES."
2316 (if (stringp addresses) 2314 (if (stringp addresses)
2317 (spam-enter-list (list addresses) file remove) 2315 (spam-enter-list (list addresses) file remove)
2318 ;; else, we have a list of addresses here 2316 ;; else, we have a list of addresses here
@@ -2467,7 +2465,7 @@ REMOVE not nil, remove the ADDRESSES."
2467 (spam-report-resend-register-routine articles t)) 2465 (spam-report-resend-register-routine articles t))
2468 2466
2469(defun spam-report-resend-register-routine (articles &optional ham) 2467(defun spam-report-resend-register-routine (articles &optional ham)
2470 (let* ((resend-to-gp 2468 (let* ((resend-to-gp
2471 (if ham 2469 (if ham
2472 (gnus-parameter-ham-resend-to gnus-newsgroup-name) 2470 (gnus-parameter-ham-resend-to gnus-newsgroup-name)
2473 (gnus-parameter-spam-resend-to gnus-newsgroup-name))) 2471 (gnus-parameter-spam-resend-to gnus-newsgroup-name)))
@@ -2492,7 +2490,7 @@ REMOVE not nil, remove the ADDRESSES."
2492 2490
2493;; return something sensible if the score can't be determined 2491;; return something sensible if the score can't be determined
2494(defun spam-bogofilter-score (&optional recheck) 2492(defun spam-bogofilter-score (&optional recheck)
2495 "Get the Bogofilter spamicity score" 2493 "Get the Bogofilter spamicity score."
2496 (interactive "P") 2494 (interactive "P")
2497 (save-window-excursion 2495 (save-window-excursion
2498 (gnus-summary-show-article t) 2496 (gnus-summary-show-article t)
@@ -2509,10 +2507,10 @@ REMOVE not nil, remove the ADDRESSES."
2509 (when (eq spam-bogofilter-valid 'unknown) 2507 (when (eq spam-bogofilter-valid 'unknown)
2510 (setq spam-bogofilter-valid 2508 (setq spam-bogofilter-valid
2511 (not (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\." 2509 (not (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\."
2512 (shell-command-to-string 2510 (shell-command-to-string
2513 (format "%s -V" spam-bogofilter-program)))))) 2511 (format "%s -V" spam-bogofilter-program))))))
2514 spam-bogofilter-valid) 2512 spam-bogofilter-valid)
2515 2513
2516(defun spam-check-bogofilter (&optional score) 2514(defun spam-check-bogofilter (&optional score)
2517 "Check the Bogofilter backend for the classification of this message." 2515 "Check the Bogofilter backend for the classification of this message."
2518 (if (spam-verify-bogofilter) 2516 (if (spam-verify-bogofilter)
@@ -2550,7 +2548,7 @@ REMOVE not nil, remove the ADDRESSES."
2550 (when (stringp article-string) 2548 (when (stringp article-string)
2551 (with-temp-buffer 2549 (with-temp-buffer
2552 (insert article-string) 2550 (insert article-string)
2553 2551
2554 (apply 'call-process-region 2552 (apply 'call-process-region
2555 (point-min) (point-max) 2553 (point-min) (point-max)
2556 spam-bogofilter-program 2554 spam-bogofilter-program
@@ -2736,7 +2734,7 @@ REMOVE not nil, remove the ADDRESSES."
2736 2734
2737;; return something sensible if the score can't be determined 2735;; return something sensible if the score can't be determined
2738(defun spam-bsfilter-score (&optional recheck) 2736(defun spam-bsfilter-score (&optional recheck)
2739 "Get the Bsfilter spamicity score" 2737 "Get the Bsfilter spamicity score."
2740 (interactive "P") 2738 (interactive "P")
2741 (save-window-excursion 2739 (save-window-excursion
2742 (gnus-summary-show-article t) 2740 (gnus-summary-show-article t)
@@ -2749,7 +2747,7 @@ REMOVE not nil, remove the ADDRESSES."
2749 (or score "0")))) 2747 (or score "0"))))
2750 2748
2751(defun spam-check-bsfilter (&optional score) 2749(defun spam-check-bsfilter (&optional score)
2752 "Check the Bsfilter backend for the classification of this message" 2750 "Check the Bsfilter backend for the classification of this message."
2753 (let ((article-buffer-name (buffer-name)) 2751 (let ((article-buffer-name (buffer-name))
2754 (dir spam-bsfilter-database-directory) 2752 (dir spam-bsfilter-database-directory)
2755 return) 2753 return)
@@ -2823,7 +2821,7 @@ REMOVE not nil, remove the ADDRESSES."
2823 2821
2824;; return something sensible if the score can't be determined 2822;; return something sensible if the score can't be determined
2825(defun spam-crm114-score () 2823(defun spam-crm114-score ()
2826 "Get the CRM114 Mailfilter pR" 2824 "Get the CRM114 Mailfilter pR."
2827 (interactive) 2825 (interactive)
2828 (save-window-excursion 2826 (save-window-excursion
2829 (gnus-summary-show-article t) 2827 (gnus-summary-show-article t)
@@ -2835,7 +2833,7 @@ REMOVE not nil, remove the ADDRESSES."
2835 (or score "0")))) 2833 (or score "0"))))
2836 2834
2837(defun spam-check-crm114 (&optional score) 2835(defun spam-check-crm114 (&optional score)
2838 "Check the CRM114 Mailfilter backend for the classification of this message" 2836 "Check the CRM114 Mailfilter backend for the classification of this message."
2839 (let ((article-buffer-name (buffer-name)) 2837 (let ((article-buffer-name (buffer-name))
2840 (db spam-crm114-database-directory) 2838 (db spam-crm114-database-directory)
2841 return) 2839 return)
@@ -2897,9 +2895,9 @@ REMOVE not nil, remove the ADDRESSES."
2897(defun spam-initialize (&rest symbols) 2895(defun spam-initialize (&rest symbols)
2898 "Install the spam.el hooks and do other initialization. 2896 "Install the spam.el hooks and do other initialization.
2899When SYMBOLS is given, set those variables to t. This is so you 2897When SYMBOLS is given, set those variables to t. This is so you
2900can call spam-initialize before you set spam-use-* variables on 2898can call `spam-initialize' before you set spam-use-* variables on
2901explicitly, and matters only if you need the extra headers 2899explicitly, and matters only if you need the extra headers
2902installed through spam-necessary-extra-headers." 2900installed through `spam-necessary-extra-headers'."
2903 (interactive) 2901 (interactive)
2904 2902
2905 (dolist (var symbols) 2903 (dolist (var symbols)
@@ -2923,7 +2921,7 @@ installed through spam-necessary-extra-headers."
2923 (add-hook 'gnus-summary-prepared-hook 'spam-find-spam)) 2921 (add-hook 'gnus-summary-prepared-hook 'spam-find-spam))
2924 2922
2925(defun spam-unload-hook () 2923(defun spam-unload-hook ()
2926 "Uninstall the spam.el hooks" 2924 "Uninstall the spam.el hooks."
2927 (interactive) 2925 (interactive)
2928 (remove-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save) 2926 (remove-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save)
2929 (remove-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load) 2927 (remove-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load)