Mercurial > emacs
annotate lisp/gnus/spam.el @ 112393:f7e256e5ea88
gnus-art.el (gnus-article-remove-images, gnus-article-show-images): Widen article buffer.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Fri, 21 Jan 2011 04:16:57 +0000 |
parents | 539ff9c0e704 |
children |
rev | line source |
---|---|
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1 ;;; spam.el --- Identifying spam |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
2 |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
106815
diff
changeset
|
3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 |
95820
645fb33380d6
Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents:
94662
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
5 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
7 ;; Maintainer: Ted Zlatanov <tzz@lifelogs.com> |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
8 ;; Keywords: network, spam, mail, bogofilter, BBDB, dspam, dig, whitelist, blacklist, gmane, hashcash, spamassassin, bsfilter, ifile, stat, crm114, spamoracle |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
9 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
10 ;; This file is part of GNU Emacs. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
11 |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
13 ;; it under the terms of the GNU General Public License as published by |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; the Free Software Foundation, either version 3 of the License, or |
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
15 ;; (at your option) any later version. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
16 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
17 ;; GNU Emacs is distributed in the hope that it will be useful, |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
20 ;; GNU General Public License for more details. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
21 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
22 ;; You should have received a copy of the GNU General Public License |
94662
f42ef85caf91
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
24 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
25 ;;; Commentary: |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
26 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
27 ;;; This module addresses a few aspects of spam control under Gnus. Page |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
28 ;;; breaks are used for grouping declarations and documentation relating to |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
29 ;;; each particular aspect. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
30 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
31 ;;; The integration with Gnus is not yet complete. See various `FIXME' |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
32 ;;; comments, below, for supplementary explanations or discussions. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
33 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
34 ;;; Several TODO items are marked as such |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
35 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
36 ;; TODO: cross-server splitting, remote processing, training through files |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
37 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
38 ;;; Code: |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
39 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
40 ;;{{{ compilation directives and autoloads/requires |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
41 |
110918
236342431786
nnimap.el (gnutls-negotiate): Silence the byte compiler.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110898
diff
changeset
|
42 ;; For Emacs <22.2 and XEmacs. |
87226
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
43 (eval-and-compile |
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
44 (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) |
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
45 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
46 (eval-when-compile (require 'cl)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
47 |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
48 (require 'message) ;for the message-fetch-field functions |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
49 (require 'gnus-sum) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
50 (require 'gnus-uu) ; because of key prefix issues |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
51 ;;; for the definitions of group content classification and spam processors |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
52 (require 'gnus) |
87226
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
53 |
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
54 (eval-when-compile (require 'spam-report)) |
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
55 (eval-when-compile (require 'hashcash)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
56 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
57 ;; for nnimap-split-download-body-default |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
58 (eval-when-compile (require 'nnimap)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
59 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
60 ;; autoload query-dig |
95820
645fb33380d6
Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents:
94662
diff
changeset
|
61 (autoload 'query-dig "dig") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
62 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
63 ;; autoload spam-report |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
64 (eval-and-compile |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
65 (autoload 'spam-report-gmane "spam-report") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
66 (autoload 'spam-report-gmane-spam "spam-report") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
67 (autoload 'spam-report-gmane-ham "spam-report") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
68 (autoload 'spam-report-resend "spam-report")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
69 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
70 ;; autoload gnus-registry |
95820
645fb33380d6
Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents:
94662
diff
changeset
|
71 (autoload 'gnus-registry-group-count "gnus-registry") |
645fb33380d6
Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents:
94662
diff
changeset
|
72 (autoload 'gnus-registry-add-group "gnus-registry") |
645fb33380d6
Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents:
94662
diff
changeset
|
73 (autoload 'gnus-registry-store-extra-entry "gnus-registry") |
645fb33380d6
Remove unnecessary eval-and-compile of autoloads.
Glenn Morris <rgm@gnu.org>
parents:
94662
diff
changeset
|
74 (autoload 'gnus-registry-fetch-extra "gnus-registry") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
75 |
103091
0062b68a76c3
Use dns-query instead of query-dns. Was renamed on 2008-12-25 in dns.el.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
100908
diff
changeset
|
76 ;; autoload dns-query |
0062b68a76c3
Use dns-query instead of query-dns. Was renamed on 2008-12-25 in dns.el.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
100908
diff
changeset
|
77 (autoload 'dns-query "dns") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
78 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
79 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
80 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
81 ;;{{{ Main parameters. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
82 (defvar spam-backends nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
83 "List of spam.el backends with all the pertinent data. |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
84 Populated by `spam-install-backend-super'.") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
85 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
86 (defgroup spam nil |
57931
a40ae7cf2194
(spam group): Add :version.
Richard M. Stallman <rms@gnu.org>
parents:
57581
diff
changeset
|
87 "Spam configuration." |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
88 :version "22.1" |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
89 :group 'mail |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
90 :group 'news) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
91 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
92 (defcustom spam-summary-exit-behavior 'default |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
93 "Exit behavior at the time of summary exit. |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
94 Note that setting the `spam-use-move' or `spam-use-copy' backends on |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
95 a group through group/topic parameters overrides this mechanism." |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
96 :type '(choice |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
97 (const |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
98 'default |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
99 :tag "Move spam out of all groups and ham out of spam groups.") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
100 (const |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
101 'move-all |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
102 :tag "Move spam out of all groups and ham out of all groups.") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
103 (const |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
104 'move-none |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
105 :tag "Never move spam or ham out of any groups.")) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
106 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
107 |
57581
645f020dcc8a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-626
Miles Bader <miles@gnu.org>
parents:
57549
diff
changeset
|
108 (defcustom spam-directory (nnheader-concat gnus-directory "spam/") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
109 "Directory for spam whitelists and blacklists." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
110 :type 'directory |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
111 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
112 |
69625
17473f7e626b
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-170
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
113 (defcustom spam-mark-new-messages-in-spam-group-as-spam t |
17473f7e626b
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-170
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
114 "Whether new messages in a spam group should get the spam-mark." |
17473f7e626b
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-170
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
115 :type 'boolean |
17473f7e626b
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-170
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
116 ;; :version "22.1" ;; Gnus 5.10.8 / No Gnus 0.3 |
17473f7e626b
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-170
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
117 :group 'spam) |
17473f7e626b
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-170
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
118 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
119 (defcustom spam-log-to-registry nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
120 "Whether spam/ham processing should be logged in the registry." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
121 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
122 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
123 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
124 (defcustom spam-split-symbolic-return nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
125 "Whether `spam-split' should work with symbols or group names." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
126 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
127 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
128 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
129 (defcustom spam-split-symbolic-return-positive nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
130 "Whether `spam-split' should ALWAYS work with symbols or group names. |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
131 Do not set this if you use `spam-split' in a fancy split method." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
132 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
133 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
134 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
135 (defcustom spam-mark-only-unseen-as-spam t |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
136 "Whether only unseen articles should be marked as spam in spam groups. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
137 When nil, all unread articles in a spam group are marked as |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
138 spam. Set this if you want to leave an article unread in a spam group |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
139 without losing it to the automatic spam-marking process." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
140 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
141 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
142 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
143 (defcustom spam-mark-ham-unread-before-move-from-spam-group nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
144 "Whether ham should be marked unread before it's moved. |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
145 The article is moved out of a spam group according to `ham-process-destination'. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
146 This variable is an official entry in the international Longest Variable Name |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
147 Competition." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
148 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
149 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
150 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
151 (defcustom spam-disable-spam-split-during-ham-respool nil |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
152 "Whether `spam-split' should be ignored while resplitting ham. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
153 This is useful to prevent ham from ending up in the same spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
154 group after the resplit. Don't set this to t if you have `spam-split' as the |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
155 last rule in your split configuration." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
156 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
157 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
158 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
159 (defcustom spam-autodetect-recheck-messages nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
160 "Should spam.el recheck all meessages when autodetecting? |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
161 Normally this is nil, so only unseen messages will be checked." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
162 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
163 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
164 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
165 (defcustom spam-whitelist (expand-file-name "whitelist" spam-directory) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
166 "The location of the whitelist. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
167 The file format is one regular expression per line. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
168 The regular expression is matched against the address." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
169 :type 'file |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
170 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
171 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
172 (defcustom spam-blacklist (expand-file-name "blacklist" spam-directory) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
173 "The location of the blacklist. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
174 The file format is one regular expression per line. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
175 The regular expression is matched against the address." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
176 :type 'file |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
177 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
178 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
179 (defcustom spam-use-dig t |
103091
0062b68a76c3
Use dns-query instead of query-dns. Was renamed on 2008-12-25 in dns.el.
Reiner Steib <Reiner.Steib@gmx.de>
parents:
100908
diff
changeset
|
180 "Whether `query-dig' should be used instead of `dns-query'." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
181 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
182 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
183 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
184 (defcustom spam-use-gmane-xref nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
185 "Whether the Gmane spam xref should be used by `spam-split'." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
186 :type 'boolean |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
187 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
188 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
189 (defcustom spam-use-blacklist nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
190 "Whether the blacklist should be used by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
191 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
192 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
193 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
194 (defcustom spam-blacklist-ignored-regexes nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
195 "Regular expressions that the blacklist should ignore." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
196 :type '(repeat (regexp :tag "Regular expression to ignore when blacklisting")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
197 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
198 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
199 (defcustom spam-use-whitelist nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
200 "Whether the whitelist should be used by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
201 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
202 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
203 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
204 (defcustom spam-use-whitelist-exclusive nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
205 "Whether whitelist-exclusive should be used by `spam-split'. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
206 Exclusive whitelisting means that all messages from senders not in the whitelist |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
207 are considered spam." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
208 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
209 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
210 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
211 (defcustom spam-use-blackholes nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
212 "Whether blackholes should be used by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
213 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
214 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
215 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
216 (defcustom spam-use-hashcash nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
217 "Whether hashcash payments should be detected by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
218 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
219 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
220 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
221 (defcustom spam-use-regex-headers nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
222 "Whether a header regular expression match should be used by `spam-split'. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
223 Also see the variables `spam-regex-headers-spam' and `spam-regex-headers-ham'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
224 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
225 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
226 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
227 (defcustom spam-use-regex-body nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
228 "Whether a body regular expression match should be used by `spam-split'. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
229 Also see the variables `spam-regex-body-spam' and `spam-regex-body-ham'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
230 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
231 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
232 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
233 (defcustom spam-use-bogofilter-headers nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
234 "Whether bogofilter headers should be used by `spam-split'. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
235 Enable this if you pre-process messages with Bogofilter BEFORE Gnus sees them." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
236 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
237 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
238 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
239 (defcustom spam-use-bogofilter nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
240 "Whether bogofilter should be invoked by `spam-split'. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
241 Enable this if you want Gnus to invoke Bogofilter on new messages." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
242 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
243 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
244 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
245 (defcustom spam-use-bsfilter-headers nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
246 "Whether bsfilter headers should be used by `spam-split'. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
247 Enable this if you pre-process messages with Bsfilter BEFORE Gnus sees them." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
248 :type 'boolean |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
249 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
250 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
251 (defcustom spam-use-bsfilter nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
252 "Whether bsfilter should be invoked by `spam-split'. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
253 Enable this if you want Gnus to invoke Bsfilter on new messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
254 :type 'boolean |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
255 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
256 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
257 (defcustom spam-use-BBDB nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
258 "Whether BBDB should be used by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
259 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
260 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
261 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
262 (defcustom spam-use-BBDB-exclusive nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
263 "Whether BBDB-exclusive should be used by `spam-split'. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
264 Exclusive BBDB means that all messages from senders not in the BBDB are |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
265 considered spam." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
266 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
267 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
268 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
269 (defcustom spam-use-ifile nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
270 "Whether ifile should be used by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
271 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
272 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
273 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
274 (defcustom spam-use-stat nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
275 "Whether `spam-stat' should be used by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
276 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
277 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
278 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
279 (defcustom spam-use-spamoracle nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
280 "Whether spamoracle should be used by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
281 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
282 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
283 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
284 (defcustom spam-use-spamassassin nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
285 "Whether spamassassin should be invoked by `spam-split'. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
286 Enable this if you want Gnus to invoke SpamAssassin on new messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
287 :type 'boolean |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
288 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
289 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
290 (defcustom spam-use-spamassassin-headers nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
291 "Whether spamassassin headers should be checked by `spam-split'. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
292 Enable this if you pre-process messages with SpamAssassin BEFORE Gnus sees |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
293 them." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
294 :type 'boolean |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
295 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
296 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
297 (defcustom spam-use-crm114 nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
298 "Whether the CRM114 Mailfilter should be used by `spam-split'." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
299 :type 'boolean |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
300 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
301 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
302 (defcustom spam-install-hooks (or |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
303 spam-use-dig |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
304 spam-use-gmane-xref |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
305 spam-use-blacklist |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
306 spam-use-whitelist |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
307 spam-use-whitelist-exclusive |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
308 spam-use-blackholes |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
309 spam-use-hashcash |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
310 spam-use-regex-headers |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
311 spam-use-regex-body |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
312 spam-use-bogofilter |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
313 spam-use-bogofilter-headers |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
314 spam-use-spamassassin |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
315 spam-use-spamassassin-headers |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
316 spam-use-bsfilter |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
317 spam-use-bsfilter-headers |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
318 spam-use-BBDB |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
319 spam-use-BBDB-exclusive |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
320 spam-use-ifile |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
321 spam-use-stat |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
322 spam-use-spamoracle |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
323 spam-use-crm114) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
324 "Whether the spam hooks should be installed. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
325 Default to t if one of the spam-use-* variables is set." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
326 :group 'spam |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
327 :type 'boolean) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
328 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
329 (defcustom spam-split-group "spam" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
330 "Group name where incoming spam should be put by `spam-split'." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
331 :type 'string |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
332 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
333 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
334 ;;; TODO: deprecate this variable, it's confusing since it's a list of strings, |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
335 ;;; not regular expressions |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
336 (defcustom spam-junk-mailgroups (cons |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
337 spam-split-group |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
338 '("mail.junk" "poste.pourriel")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
339 "Mailgroups with spam contents. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
340 All unmarked article in such group receive the spam mark on group entry." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
341 :type '(repeat (string :tag "Group")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
342 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
343 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
344 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
345 (defcustom spam-gmane-xref-spam-group "gmane.spam.detected" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
346 "The group where spam xrefs can be found on Gmane. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
347 Only meaningful if you enable `spam-use-gmane-xref'." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
348 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
349 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
350 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
351 (defcustom spam-blackhole-servers '("bl.spamcop.net" "relays.ordb.org" |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
352 "dev.null.dk" "relays.visi.com") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
353 "List of blackhole servers. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
354 Only meaningful if you enable `spam-use-blackholes'." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
355 :type '(repeat (string :tag "Server")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
356 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
357 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
358 (defcustom spam-blackhole-good-server-regex nil |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
359 "String matching IP addresses that should not be checked in the blackholes. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
360 Only meaningful if you enable `spam-use-blackholes'." |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
361 :type '(radio (const nil) regexp) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
362 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
363 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62755
diff
changeset
|
364 (defface spam |
59406
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
365 '((((class color) (type tty) (background dark)) |
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
366 (:foreground "gray80" :background "gray50")) |
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
367 (((class color) (type tty) (background light)) |
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
368 (:foreground "gray50" :background "gray80")) |
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
369 (((class color) (background dark)) |
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
370 (:foreground "ivory2")) |
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
371 (((class color) (background light)) |
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
372 (:foreground "ivory4")) |
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
373 (t :inverse-video t)) |
62755
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
374 "Face for spam-marked articles." |
0d1a48b1ca68
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-324
Miles Bader <miles@gnu.org>
parents:
59996
diff
changeset
|
375 :group 'spam) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62755
diff
changeset
|
376 ;; backward-compatibility alias |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62755
diff
changeset
|
377 (put 'spam-face 'face-alias 'spam) |
104789
aa91debbb2f2
Mark face aliases with "-face" in the name as obsolete.
Glenn Morris <rgm@gnu.org>
parents:
104700
diff
changeset
|
378 (put 'spam-face 'obsolete-face "22.1") |
59406
cf93431040c9
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Miles Bader <miles@gnu.org>
parents:
58835
diff
changeset
|
379 |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62755
diff
changeset
|
380 (defcustom spam-face 'spam |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
381 "Face for spam-marked articles." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
382 :type 'face |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
383 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
384 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
385 (defcustom spam-regex-headers-spam '("^X-Spam-Flag: YES") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
386 "Regular expression for positive header spam matches. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
387 Only meaningful if you enable `spam-use-regex-headers'." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
388 :type '(repeat (regexp :tag "Regular expression to match spam header")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
389 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
390 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
391 (defcustom spam-regex-headers-ham '("^X-Spam-Flag: NO") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
392 "Regular expression for positive header ham matches. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
393 Only meaningful if you enable `spam-use-regex-headers'." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
394 :type '(repeat (regexp :tag "Regular expression to match ham header")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
395 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
396 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
397 (defcustom spam-regex-body-spam '() |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
398 "Regular expression for positive body spam matches. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
399 Only meaningful if you enable `spam-use-regex-body'." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
400 :type '(repeat (regexp :tag "Regular expression to match spam body")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
401 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
402 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
403 (defcustom spam-regex-body-ham '() |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
404 "Regular expression for positive body ham matches. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
405 Only meaningful if you enable `spam-use-regex-body'." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
406 :type '(repeat (regexp :tag "Regular expression to match ham body")) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
407 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
408 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
409 (defcustom spam-summary-score-preferred-header nil |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
410 "Preferred header to use for `spam-summary-score'." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
411 :type '(choice :tag "Header name" |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
412 (symbol :tag "SpamAssassin etc" X-Spam-Status) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
413 (symbol :tag "Bogofilter" X-Bogosity) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
414 (const :tag "No preference, take best guess." nil)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
415 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
416 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
417 (defgroup spam-ifile nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
418 "Spam ifile configuration." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
419 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
420 |
104700
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
421 (make-obsolete-variable 'spam-ifile-path 'spam-ifile-program |
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
422 "Gnus 5.10.9 (Emacs 22.1)") |
74984 | 423 (defcustom spam-ifile-program (executable-find "ifile") |
424 "Name of the ifile program." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
425 :type '(choice (file :tag "Location of ifile") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
426 (const :tag "ifile is not installed")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
427 :group 'spam-ifile) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
428 |
104700
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
429 (make-obsolete-variable 'spam-ifile-database-path 'spam-ifile-database |
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
430 "Gnus 5.10.9 (Emacs 22.1)") |
74984 | 431 (defcustom spam-ifile-database nil |
432 "File name of the ifile database." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
433 :type '(choice (file :tag "Location of the ifile database") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
434 (const :tag "Use the default")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
435 :group 'spam-ifile) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
436 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
437 (defcustom spam-ifile-spam-category "spam" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
438 "Name of the spam ifile category." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
439 :type 'string |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
440 :group 'spam-ifile) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
441 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
442 (defcustom spam-ifile-ham-category nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
443 "Name of the ham ifile category. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
444 If nil, the current group name will be used." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
445 :type '(choice (string :tag "Use a fixed category") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
446 (const :tag "Use the current group name")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
447 :group 'spam-ifile) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
448 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
449 (defcustom spam-ifile-all-categories nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
450 "Whether the ifile check will return all categories, or just spam. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
451 Set this to t if you want to use the `spam-split' invocation of ifile as |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
452 your main source of newsgroup names." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
453 :type 'boolean |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
454 :group 'spam-ifile) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
455 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
456 (defgroup spam-bogofilter nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
457 "Spam bogofilter configuration." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
458 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
459 |
104700
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
460 (make-obsolete-variable 'spam-bogofilter-path 'spam-bogofilter-program |
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
461 "Gnus 5.10.9 (Emacs 22.1)") |
74984 | 462 (defcustom spam-bogofilter-program (executable-find "bogofilter") |
463 "Name of the Bogofilter program." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
464 :type '(choice (file :tag "Location of bogofilter") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
465 (const :tag "Bogofilter is not installed")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
466 :group 'spam-bogofilter) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
467 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
468 (defvar spam-bogofilter-valid 'unknown "Is the bogofilter version valid?") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
469 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
470 (defcustom spam-bogofilter-header "X-Bogosity" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
471 "The header that Bogofilter inserts in messages." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
472 :type 'string |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
473 :group 'spam-bogofilter) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
474 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
475 (defcustom spam-bogofilter-spam-switch "-s" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
476 "The switch that Bogofilter uses to register spam messages." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
477 :type 'string |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
478 :group 'spam-bogofilter) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
479 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
480 (defcustom spam-bogofilter-ham-switch "-n" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
481 "The switch that Bogofilter uses to register ham messages." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
482 :type 'string |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
483 :group 'spam-bogofilter) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
484 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
485 (defcustom spam-bogofilter-spam-strong-switch "-S" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
486 "The switch that Bogofilter uses to unregister ham messages." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
487 :type 'string |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
488 :group 'spam-bogofilter) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
489 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
490 (defcustom spam-bogofilter-ham-strong-switch "-N" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
491 "The switch that Bogofilter uses to unregister spam messages." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
492 :type 'string |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
493 :group 'spam-bogofilter) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
494 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
495 (defcustom spam-bogofilter-bogosity-positive-spam-header "^\\(Yes\\|Spam\\)" |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
496 "The regex on `spam-bogofilter-header' for positive spam identification." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
497 :type 'regexp |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
498 :group 'spam-bogofilter) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
499 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
500 (defcustom spam-bogofilter-database-directory nil |
74984 | 501 "Location of the Bogofilter database. |
502 When nil, use the default location." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
503 :type '(choice (directory |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
504 :tag "Location of the Bogofilter database directory") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
505 (const :tag "Use the default")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
506 :group 'spam-bogofilter) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
507 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
508 (defgroup spam-bsfilter nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
509 "Spam bsfilter configuration." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
510 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
511 |
104700
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
512 (make-obsolete-variable 'spam-bsfilter-path 'spam-bsfilter-program |
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
513 "Gnus 5.10.9 (Emacs 22.1)") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
514 (defcustom spam-bsfilter-program (executable-find "bsfilter") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
515 "Name of the Bsfilter program." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
516 :type '(choice (file :tag "Location of bsfilter") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
517 (const :tag "Bsfilter is not installed")) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
518 :group 'spam-bsfilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
519 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
520 (defcustom spam-bsfilter-header "X-Spam-Flag" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
521 "The header inserted by Bsfilter to flag spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
522 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
523 :group 'spam-bsfilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
524 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
525 (defcustom spam-bsfilter-probability-header "X-Spam-Probability" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
526 "The header that Bsfilter inserts in messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
527 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
528 :group 'spam-bsfilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
529 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
530 (defcustom spam-bsfilter-spam-switch "--add-spam" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
531 "The switch that Bsfilter uses to register spam messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
532 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
533 :group 'spam-bsfilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
534 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
535 (defcustom spam-bsfilter-ham-switch "--add-clean" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
536 "The switch that Bsfilter uses to register ham messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
537 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
538 :group 'spam-bsfilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
539 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
540 (defcustom spam-bsfilter-spam-strong-switch "--sub-spam" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
541 "The switch that Bsfilter uses to unregister ham messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
542 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
543 :group 'spam-bsfilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
544 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
545 (defcustom spam-bsfilter-ham-strong-switch "--sub-clean" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
546 "The switch that Bsfilter uses to unregister spam messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
547 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
548 :group 'spam-bsfilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
549 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
550 (defcustom spam-bsfilter-database-directory nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
551 "Directory path of the Bsfilter databases." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
552 :type '(choice (directory |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
553 :tag "Location of the Bsfilter database directory") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
554 (const :tag "Use the default")) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
555 :group 'spam-bsfilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
556 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
557 (defgroup spam-spamoracle nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
558 "Spam spamoracle configuration." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
559 :group 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
560 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
561 (defcustom spam-spamoracle-database nil |
74984 | 562 "Location of spamoracle database file. |
563 When nil, use the default spamoracle database." | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
564 :type '(choice (directory :tag "Location of spamoracle database file.") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
565 (const :tag "Use the default")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
566 :group 'spam-spamoracle) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
567 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
568 (defcustom spam-spamoracle-binary (executable-find "spamoracle") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
569 "Location of the spamoracle binary." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
570 :type '(choice (directory :tag "Location of the spamoracle binary") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
571 (const :tag "Use the default")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
572 :group 'spam-spamoracle) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
573 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
574 (defgroup spam-spamassassin nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
575 "Spam SpamAssassin configuration." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
576 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
577 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
578 (make-obsolete-variable 'spam-spamassassin-path |
104700
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
579 'spam-spamassassin-program "Gnus 5.10.9 (Emacs 22.1)") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
580 (defcustom spam-assassin-program (executable-find "spamassassin") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
581 "Name of the spamassassin program. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
582 Hint: set this to \"spamc\" if you have spamd running. See the spamc and |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
583 spamd man pages for more information on these programs." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
584 :type '(choice (file :tag "Location of spamc") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
585 (const :tag "spamassassin is not installed")) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
586 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
587 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
588 (defcustom spam-spamassassin-arguments () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
589 "Arguments to pass to the spamassassin executable. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
590 This must be a list. For example, `(\"-C\" \"configfile\")'." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
591 :type '(restricted-sexp :match-alternatives (listp)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
592 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
593 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
594 (defcustom spam-spamassassin-spam-flag-header "X-Spam-Flag" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
595 "The header inserted by SpamAssassin to flag spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
596 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
597 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
598 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
599 (defcustom spam-spamassassin-positive-spam-flag-header "YES" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
600 "The regex on `spam-spamassassin-spam-flag-header' for positive spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
601 identification" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
602 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
603 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
604 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
605 (defcustom spam-spamassassin-spam-status-header "X-Spam-Status" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
606 "The header inserted by SpamAssassin, giving extended scoring information" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
607 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
608 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
609 |
104700
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
610 (make-obsolete-variable 'spam-sa-learn-path 'spam-sa-learn-program |
9866b069527c
* spam.el (spam-ifile-path, spam-bogofilter-path, spam-sa-learn-path)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
103091
diff
changeset
|
611 "Gnus 5.10.9 (Emacs 22.1)") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
612 (defcustom spam-sa-learn-program (executable-find "sa-learn") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
613 "Name of the sa-learn program." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
614 :type '(choice (file :tag "Location of spamassassin") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
615 (const :tag "spamassassin is not installed")) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
616 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
617 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
618 (defcustom spam-sa-learn-rebuild t |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
619 "Whether sa-learn should rebuild the database every time it is called |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
620 Enable this if you want sa-learn to rebuild the database automatically. Doing |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
621 this will slightly increase the running time of the spam registration process. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
622 If you choose not to do this, you will have to run \"sa-learn --rebuild\" in |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
623 order for SpamAssassin to recognize the new registered spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
624 :type 'boolean |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
625 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
626 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
627 (defcustom spam-sa-learn-spam-switch "--spam" |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
628 "The switch that sa-learn uses to register spam messages." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
629 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
630 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
631 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
632 (defcustom spam-sa-learn-ham-switch "--ham" |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
633 "The switch that sa-learn uses to register ham messages." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
634 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
635 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
636 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
637 (defcustom spam-sa-learn-unregister-switch "--forget" |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
638 "The switch that sa-learn uses to unregister messages messages." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
639 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
640 :group 'spam-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
641 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
642 (defgroup spam-crm114 nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
643 "Spam CRM114 Mailfilter configuration." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
644 :group 'spam) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
645 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
646 (defcustom spam-crm114-program (executable-find "mailfilter.crm") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
647 "File path of the CRM114 Mailfilter executable program." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
648 :type '(choice (file :tag "Location of CRM114 Mailfilter") |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
649 (const :tag "CRM114 Mailfilter is not installed")) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
650 :group 'spam-crm114) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
651 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
652 (defcustom spam-crm114-header "X-CRM114-Status" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
653 "The header that CRM114 Mailfilter inserts in messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
654 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
655 :group 'spam-crm114) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
656 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
657 (defcustom spam-crm114-spam-switch "--learnspam" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
658 "The switch that CRM114 Mailfilter uses to register spam messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
659 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
660 :group 'spam-crm114) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
661 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
662 (defcustom spam-crm114-ham-switch "--learnnonspam" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
663 "The switch that CRM114 Mailfilter uses to register ham messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
664 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
665 :group 'spam-crm114) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
666 |
105253
baa4e6ac9e46
Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
104789
diff
changeset
|
667 (defcustom spam-crm114-spam-strong-switch "--unlearn" |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
668 "The switch that CRM114 Mailfilter uses to unregister ham messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
669 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
670 :group 'spam-crm114) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
671 |
105253
baa4e6ac9e46
Synch with Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
104789
diff
changeset
|
672 (defcustom spam-crm114-ham-strong-switch "--unlearn" |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
673 "The switch that CRM114 Mailfilter uses to unregister spam messages." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
674 :type 'string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
675 :group 'spam-crm114) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
676 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
677 (defcustom spam-crm114-positive-spam-header "^SPAM" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
678 "The regex on `spam-crm114-header' for positive spam identification." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
679 :type 'regexp |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
680 :group 'spam-crm114) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
681 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
682 (defcustom spam-crm114-database-directory nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
683 "Directory path of the CRM114 Mailfilter databases." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
684 :type '(choice (directory |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
685 :tag "Location of the CRM114 Mailfilter database directory") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
686 (const :tag "Use the default")) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
687 :group 'spam-crm114) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
688 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
689 ;;; Key bindings for spam control. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
690 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
691 (gnus-define-keys gnus-summary-mode-map |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
692 "St" spam-generic-score |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
693 "Sx" gnus-summary-mark-as-spam |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
694 "Mst" spam-generic-score |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
695 "Msx" gnus-summary-mark-as-spam |
110898
069deed4cdec
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110410
diff
changeset
|
696 "\M-d" gnus-summary-mark-as-spam |
069deed4cdec
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110410
diff
changeset
|
697 "$" gnus-summary-mark-as-spam) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
698 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
699 (defvar spam-cache-lookups t |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
700 "Whether spam.el will try to cache lookups using `spam-caches'.") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
701 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
702 (defvar spam-caches (make-hash-table |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
703 :size 10 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
704 :test 'equal) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
705 "Cache of spam detection entries.") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
706 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
707 (defvar spam-old-articles nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
708 "List of old ham and spam articles, generated when a group is entered.") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
709 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
710 (defvar spam-split-disabled nil |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
711 "If non-nil, `spam-split' is disabled, and always returns nil.") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
712 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
713 (defvar spam-split-last-successful-check nil |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
714 "Internal variable. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
715 `spam-split' will set this to nil or a spam-use-XYZ check if it |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
716 finds ham or spam.") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
717 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
718 ;; internal variables for backends |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
719 ;; TODO: find a way to create these on the fly in spam-install-backend-super |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
720 (defvar spam-use-copy nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
721 (defvar spam-use-move nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
722 (defvar spam-use-gmane nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
723 (defvar spam-use-resend nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
724 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
725 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
726 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
727 ;;{{{ convenience functions |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
728 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
729 (defun spam-clear-cache (symbol) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
730 "Clear the `spam-caches' entry for a check." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
731 (remhash symbol spam-caches)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
732 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
733 (defun spam-xor (a b) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
734 "Logical A xor B." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
735 (and (or a b) (not (and a b)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
736 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
737 (defun spam-set-difference (list1 list2) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
738 "Return a set difference of LIST1 and LIST2. |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
739 When either list is nil, the other is returned." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
740 (if (and list1 list2) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
741 ;; we have two non-nil lists |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
742 (progn |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
743 (dolist (item (append list1 list2)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
744 (when (and (memq item list1) (memq item list2)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
745 (setq list1 (delq item list1)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
746 (setq list2 (delq item list2)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
747 (append list1 list2)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
748 ;; if either of the lists was nil, return the other one |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
749 (if list1 list1 list2))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
750 |
68276
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
751 (defun spam-group-ham-mark-p (group mark &optional spam) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
752 "Checks if MARK is considered a ham mark in GROUP." |
68276
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
753 (when (stringp group) |
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
754 (let* ((marks (spam-group-ham-marks group spam)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
755 (marks (if (symbolp mark) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
756 marks |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
757 (mapcar 'symbol-value marks)))) |
68276
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
758 (memq mark marks)))) |
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
759 |
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
760 (defun spam-group-spam-mark-p (group mark) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
761 "Checks if MARK is considered a spam mark in GROUP." |
68276
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
762 (spam-group-ham-mark-p group mark t)) |
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
763 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
764 (defun spam-group-ham-marks (group &optional spam) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
765 "In GROUP, get all the ham marks." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
766 (when (stringp group) |
68276
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
767 (let* ((marks (if spam |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
768 (gnus-parameter-spam-marks group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
769 (gnus-parameter-ham-marks group))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
770 (marks (car marks)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
771 (marks (if (listp (car marks)) (car marks) marks))) |
68276
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
772 marks))) |
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
773 |
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
774 (defun spam-group-spam-marks (group) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
775 "In GROUP, get all the spam marks." |
68276
873a6f48b596
(spam-group-ham-mark-p, spam-group-spam-mark-p)
Reiner Steib <Reiner.Steib@gmx.de>
parents:
68093
diff
changeset
|
776 (spam-group-ham-marks group t)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
777 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
778 (defun spam-group-spam-contents-p (group) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
779 "Is GROUP a spam group?" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
780 (if (and (stringp group) (< 0 (length group))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
781 (or (member group spam-junk-mailgroups) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
782 (memq 'gnus-group-spam-classification-spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
783 (gnus-parameter-spam-contents group))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
784 nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
785 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
786 (defun spam-group-ham-contents-p (group) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
787 "Is GROUP a ham group?" |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
788 (if (stringp group) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
789 (memq 'gnus-group-spam-classification-ham |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
790 (gnus-parameter-spam-contents group)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
791 nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
792 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
793 (defun spam-classifications () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
794 "Return list of valid classifications" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
795 '(spam ham)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
796 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
797 (defun spam-classification-valid-p (classification) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
798 "Is CLASSIFICATION a valid spam/ham classification?" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
799 (memq classification (spam-classifications))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
800 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
801 (defun spam-backend-properties () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
802 "Return list of valid classifications." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
803 '(statistical mover check hrf srf huf suf)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
804 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
805 (defun spam-backend-property-valid-p (property) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
806 "Is PROPERTY a valid backend property?" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
807 (memq property (spam-backend-properties))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
808 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
809 (defun spam-backend-function-type-valid-p (type) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
810 (or (eq type 'registration) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
811 (eq type 'unregistration))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
812 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
813 (defun spam-process-type-valid-p (process-type) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
814 (or (eq process-type 'incoming) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
815 (eq process-type 'process))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
816 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
817 (defun spam-list-articles (articles classification) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
818 (let ((mark-check (if (eq classification 'spam) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
819 'spam-group-spam-mark-p |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
820 'spam-group-ham-mark-p)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
821 alist mark-cache-yes mark-cache-no) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
822 (dolist (article articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
823 (let ((mark (gnus-summary-article-mark article))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
824 (unless (or (memq mark mark-cache-yes) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
825 (memq mark mark-cache-no)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
826 (if (funcall mark-check |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
827 gnus-newsgroup-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
828 mark) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
829 (push mark mark-cache-yes) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
830 (push mark mark-cache-no))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
831 (when (memq mark mark-cache-yes) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
832 (push article alist)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
833 alist)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
834 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
835 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
836 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
837 ;;{{{ backend installation functions and procedures |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
838 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
839 (defun spam-install-backend-super (backend &rest properties) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
840 "Install BACKEND for spam.el. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
841 Accepts incoming CHECK, ham registration function HRF, spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
842 registration function SRF, ham unregistration function HUF, spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
843 unregistration function SUF, and an indication whether the |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
844 backend is STATISTICAL." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
845 (setq spam-backends (add-to-list 'spam-backends backend)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
846 (while properties |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
847 (let ((property (pop properties)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
848 (value (pop properties))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
849 (if (spam-backend-property-valid-p property) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
850 (put backend property value) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
851 (gnus-error |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
852 5 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
853 "spam-install-backend-super got an invalid property %s" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
854 property))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
855 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
856 (defun spam-backend-list (&optional type) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
857 "Return a list of all the backend symbols, constrained by TYPE. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
858 When TYPE is 'non-mover, only non-mover backends are returned. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
859 When TYPE is 'mover, only mover backends are returned." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
860 (let (list) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
861 (dolist (backend spam-backends) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
862 (when (or |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
863 (null type) ;either no type was requested |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
864 ;; or the type is 'mover and the backend is a mover |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
865 (and |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
866 (eq type 'mover) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
867 (spam-backend-mover-p backend)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
868 ;; or the type is 'non-mover and the backend is not a mover |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
869 (and |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
870 (eq type 'non-mover) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
871 (not (spam-backend-mover-p backend)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
872 (push backend list))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
873 list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
874 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
875 (defun spam-backend-check (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
876 "Get the check function for BACKEND. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
877 Each individual check may return nil, t, or a mailgroup name. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
878 The value nil means that the check does not yield a decision, and |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
879 so, that further checks are needed. The value t means that the |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
880 message is definitely not spam, and that further spam checks |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
881 should be inhibited. Otherwise, a mailgroup name or the symbol |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
882 'spam (depending on `spam-split-symbolic-return') is returned where |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
883 the mail should go, and further checks are also inhibited. The |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
884 usual mailgroup name is the value of `spam-split-group', meaning |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
885 that the message is definitely a spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
886 (get backend 'check)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
887 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
888 (defun spam-backend-valid-p (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
889 "Is BACKEND valid?" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
890 (member backend (spam-backend-list))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
891 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
892 (defun spam-backend-info (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
893 "Return information about BACKEND." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
894 (if (spam-backend-valid-p backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
895 (let (info) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
896 (setq info (format "Backend %s has the following properties:\n" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
897 backend)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
898 (dolist (property (spam-backend-properties)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
899 (setq info (format "%s%s=%s\n" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
900 info |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
901 property |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
902 (get backend property)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
903 info) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
904 (gnus-error 5 "spam-backend-info was asked about an invalid backend %s" |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
905 backend))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
906 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
907 (defun spam-backend-function (backend classification type) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
908 "Get the BACKEND function for CLASSIFICATION and TYPE. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
909 TYPE is 'registration or 'unregistration. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
910 CLASSIFICATION is 'ham or 'spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
911 (if (and |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
912 (spam-classification-valid-p classification) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
913 (spam-backend-function-type-valid-p type)) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
914 (let ((retrieval |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
915 (intern |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
916 (format "spam-backend-%s-%s-function" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
917 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
918 type)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
919 (funcall retrieval backend)) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
920 (gnus-error |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
921 5 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
922 "%s was passed invalid backend %s, classification %s, or type %s" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
923 "spam-backend-function" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
924 backend |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
925 classification |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
926 type))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
927 |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
928 (defun spam-backend-article-list-property (classification |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
929 &optional unregister) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
930 "Property name of article list with CLASSIFICATION and UNREGISTER." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
931 (let* ((r (if unregister "unregister" "register")) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
932 (prop (format "%s-%s" classification r))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
933 prop)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
934 |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
935 (defun spam-backend-get-article-todo-list (backend |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
936 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
937 &optional unregister) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
938 "Get the articles to be processed for BACKEND and CLASSIFICATION. |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
939 With UNREGISTER, get articles to be unregistered. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
940 This is a temporary storage function - nothing here persists." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
941 (get |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
942 backend |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
943 (intern (spam-backend-article-list-property classification unregister)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
944 |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
945 (defun spam-backend-put-article-todo-list (backend classification list |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
946 &optional unregister) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
947 "Set the LIST of articles to be processed for BACKEND and CLASSIFICATION. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
948 With UNREGISTER, set articles to be unregistered. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
949 This is a temporary storage function - nothing here persists." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
950 (put |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
951 backend |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
952 (intern (spam-backend-article-list-property classification unregister)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
953 list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
954 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
955 (defun spam-backend-ham-registration-function (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
956 "Get the ham registration function for BACKEND." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
957 (get backend 'hrf)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
958 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
959 (defun spam-backend-spam-registration-function (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
960 "Get the spam registration function for BACKEND." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
961 (get backend 'srf)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
962 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
963 (defun spam-backend-ham-unregistration-function (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
964 "Get the ham unregistration function for BACKEND." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
965 (get backend 'huf)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
966 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
967 (defun spam-backend-spam-unregistration-function (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
968 "Get the spam unregistration function for BACKEND." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
969 (get backend 'suf)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
970 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
971 (defun spam-backend-statistical-p (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
972 "Is BACKEND statistical?" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
973 (get backend 'statistical)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
974 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
975 (defun spam-backend-mover-p (backend) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
976 "Is BACKEND a mover?" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
977 (get backend 'mover)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
978 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
979 (defun spam-install-backend-alias (backend alias) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
980 "Add ALIAS to an existing BACKEND. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
981 The previous backend settings for ALIAS are erased." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
982 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
983 ;; install alias with no properties at first |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
984 (spam-install-backend-super alias) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
985 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
986 (dolist (property (spam-backend-properties)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
987 (put alias property (get backend property)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
988 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
989 (defun spam-install-checkonly-backend (backend check) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
990 "Install a BACKEND than can only CHECK for spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
991 (spam-install-backend-super backend 'check check)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
992 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
993 (defun spam-install-mover-backend (backend hrf srf huf suf) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
994 "Install a BACKEND than can move articles at summary exit. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
995 Accepts ham registration function HRF, spam registration function |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
996 SRF, ham unregistration function HUF, spam unregistration |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
997 function SUF. The backend has no incoming check and can't be |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
998 statistical." |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
999 (spam-install-backend-super |
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1000 backend |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1001 'hrf hrf 'srf srf 'huf huf 'suf suf 'mover t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1002 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1003 (defun spam-install-nocheck-backend (backend hrf srf huf suf) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1004 "Install a BACKEND than has no check. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1005 Accepts ham registration function HRF, spam registration function |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1006 SRF, ham unregistration function HUF, spam unregistration |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1007 function SUF. The backend has no incoming check and can't be |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1008 statistical (it could be, but in practice that doesn't happen)." |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1009 (spam-install-backend-super |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1010 backend |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1011 'hrf hrf 'srf srf 'huf huf 'suf suf)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1012 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1013 (defun spam-install-backend (backend check hrf srf huf suf) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1014 "Install a BACKEND. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1015 Accepts incoming CHECK, ham registration function HRF, spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1016 registration function SRF, ham unregistration function HUF, spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1017 unregistration function SUF. The backend won't be |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1018 statistical (use `spam-install-statistical-backend' for that)." |
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1019 (spam-install-backend-super |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1020 backend |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1021 'check check 'hrf hrf 'srf srf 'huf huf 'suf suf)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1022 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1023 (defun spam-install-statistical-backend (backend check hrf srf huf suf) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1024 "Install a BACKEND. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1025 Accepts incoming CHECK, ham registration function HRF, spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1026 registration function SRF, ham unregistration function HUF, spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1027 unregistration function SUF. The backend will be |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1028 statistical (use `spam-install-backend' for non-statistical |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1029 backends)." |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1030 (spam-install-backend-super |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1031 backend |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1032 'check check 'statistical t 'hrf hrf 'srf srf 'huf huf 'suf suf)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1033 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1034 (defun spam-install-statistical-checkonly-backend (backend check) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1035 "Install a statistical BACKEND than can only CHECK for spam." |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1036 (spam-install-backend-super |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1037 backend |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1038 'check check 'statistical t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1039 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1040 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1041 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1042 ;;{{{ backend installations |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1043 (spam-install-checkonly-backend 'spam-use-blackholes |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1044 'spam-check-blackholes) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1045 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1046 (spam-install-checkonly-backend 'spam-use-hashcash |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1047 'spam-check-hashcash) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1048 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1049 (spam-install-checkonly-backend 'spam-use-spamassassin-headers |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1050 'spam-check-spamassassin-headers) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1051 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1052 (spam-install-checkonly-backend 'spam-use-bogofilter-headers |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1053 'spam-check-bogofilter-headers) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1054 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1055 (spam-install-checkonly-backend 'spam-use-bsfilter-headers |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1056 'spam-check-bsfilter-headers) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1057 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1058 (spam-install-checkonly-backend 'spam-use-gmane-xref |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1059 'spam-check-gmane-xref) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1060 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1061 (spam-install-checkonly-backend 'spam-use-regex-headers |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1062 'spam-check-regex-headers) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1063 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1064 (spam-install-statistical-checkonly-backend 'spam-use-regex-body |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1065 'spam-check-regex-body) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1066 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1067 ;; TODO: NOTE: spam-use-ham-copy is now obsolete, use (ham spam-use-copy) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1068 (spam-install-mover-backend 'spam-use-move |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1069 'spam-move-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1070 'spam-move-spam-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1071 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1072 nil) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1073 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1074 (spam-install-nocheck-backend 'spam-use-copy |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1075 'spam-copy-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1076 'spam-copy-spam-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1077 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1078 nil) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1079 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1080 (spam-install-nocheck-backend 'spam-use-gmane |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1081 'spam-report-gmane-unregister-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1082 'spam-report-gmane-register-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1083 'spam-report-gmane-register-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1084 'spam-report-gmane-unregister-routine) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1085 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1086 (spam-install-nocheck-backend 'spam-use-resend |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1087 'spam-report-resend-register-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1088 'spam-report-resend-register-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1089 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1090 nil) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1091 |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1092 (spam-install-backend 'spam-use-BBDB |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1093 'spam-check-BBDB |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1094 'spam-BBDB-register-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1095 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1096 'spam-BBDB-unregister-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1097 nil) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1098 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1099 (spam-install-backend-alias 'spam-use-BBDB 'spam-use-BBDB-exclusive) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1100 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1101 (spam-install-backend 'spam-use-blacklist |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1102 'spam-check-blacklist |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1103 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1104 'spam-blacklist-register-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1105 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1106 'spam-blacklist-unregister-routine) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1107 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1108 (spam-install-backend 'spam-use-whitelist |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1109 'spam-check-whitelist |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1110 'spam-whitelist-register-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1111 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1112 'spam-whitelist-unregister-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1113 nil) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1114 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1115 (spam-install-statistical-backend 'spam-use-ifile |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1116 'spam-check-ifile |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1117 'spam-ifile-register-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1118 'spam-ifile-register-spam-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1119 'spam-ifile-unregister-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1120 'spam-ifile-unregister-spam-routine) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1121 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1122 (spam-install-statistical-backend 'spam-use-spamoracle |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1123 'spam-check-spamoracle |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1124 'spam-spamoracle-learn-ham |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1125 'spam-spamoracle-learn-spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1126 'spam-spamoracle-unlearn-ham |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1127 'spam-spamoracle-unlearn-spam) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1128 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1129 (spam-install-statistical-backend 'spam-use-stat |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1130 'spam-check-stat |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1131 'spam-stat-register-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1132 'spam-stat-register-spam-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1133 'spam-stat-unregister-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1134 'spam-stat-unregister-spam-routine) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1135 |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1136 (spam-install-statistical-backend 'spam-use-spamassassin |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1137 'spam-check-spamassassin |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1138 'spam-spamassassin-register-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1139 'spam-spamassassin-register-spam-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1140 'spam-spamassassin-unregister-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1141 'spam-spamassassin-unregister-spam-routine) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1142 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1143 (spam-install-statistical-backend 'spam-use-bogofilter |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1144 'spam-check-bogofilter |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1145 'spam-bogofilter-register-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1146 'spam-bogofilter-register-spam-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1147 'spam-bogofilter-unregister-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1148 'spam-bogofilter-unregister-spam-routine) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1149 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1150 (spam-install-statistical-backend 'spam-use-bsfilter |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1151 'spam-check-bsfilter |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1152 'spam-bsfilter-register-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1153 'spam-bsfilter-register-spam-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1154 'spam-bsfilter-unregister-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1155 'spam-bsfilter-unregister-spam-routine) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1156 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1157 (spam-install-statistical-backend 'spam-use-crm114 |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1158 'spam-check-crm114 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1159 'spam-crm114-register-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1160 'spam-crm114-register-spam-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1161 'spam-crm114-unregister-ham-routine |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1162 'spam-crm114-unregister-spam-routine) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1163 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1164 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1165 ;;{{{ scoring and summary formatting |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1166 (defun spam-necessary-extra-headers () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1167 "Return the extra headers spam.el thinks are necessary." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1168 (let (list) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1169 (when (or spam-use-spamassassin |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1170 spam-use-spamassassin-headers |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1171 spam-use-regex-headers) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1172 (push 'X-Spam-Status list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1173 (when (or spam-use-bogofilter |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1174 spam-use-regex-headers) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1175 (push 'X-Bogosity list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1176 (when (or spam-use-crm114 |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1177 spam-use-regex-headers) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1178 (push 'X-CRM114-Status list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1179 list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1180 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1181 (defun spam-user-format-function-S (headers) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1182 (when headers |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1183 (format "%3.2f" |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1184 (spam-summary-score headers spam-summary-score-preferred-header)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1185 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1186 (defun spam-article-sort-by-spam-status (h1 h2) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1187 "Sort articles by score." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1188 (let (result) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1189 (dolist (header (spam-necessary-extra-headers)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1190 (let ((s1 (spam-summary-score h1 header)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1191 (s2 (spam-summary-score h2 header))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1192 (unless (= s1 s2) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1193 (setq result (< s1 s2)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1194 (return)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1195 result)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1196 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1197 (defvar spam-spamassassin-score-regexp |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1198 ".*\\b\\(?:score\\|hits\\)=\\(-?[0-9.]+\\)" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1199 "Regexp matching SpamAssassin score header. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1200 The first group must match the number.") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1201 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1202 (defun spam-extra-header-to-number (header headers) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1203 "Transform an extra HEADER to a number, using list of HEADERS. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1204 Note this has to be fast." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1205 (let ((header-content (gnus-extra-header header headers))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1206 (if header-content |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1207 (cond |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1208 ((eq header 'X-Spam-Status) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1209 (string-to-number (gnus-replace-in-string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1210 header-content |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1211 spam-spamassassin-score-regexp |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1212 "\\1"))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1213 ;; for CRM checking, it's probably faster to just do the string match |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1214 ((string-match "( pR: \\([0-9.-]+\\)" header-content) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1215 (- (string-to-number (match-string 1 header-content)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1216 ((eq header 'X-Bogosity) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1217 (string-to-number (gnus-replace-in-string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1218 (gnus-replace-in-string |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1219 header-content |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1220 ".*spamicity=" "") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1221 ",.*" ""))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1222 (t nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1223 nil))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1224 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1225 (defun spam-summary-score (headers &optional specific-header) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1226 "Score an article for the summary buffer, as fast as possible. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1227 With SPECIFIC-HEADER, returns only that header's score. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1228 Will not return a nil score." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1229 (let (score) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1230 (dolist (header |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1231 (if specific-header |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1232 (list specific-header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1233 (spam-necessary-extra-headers))) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1234 (setq score |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1235 (spam-extra-header-to-number header headers)) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1236 (when score |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1237 (return))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1238 (or score 0))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1239 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1240 (defun spam-generic-score (&optional recheck) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1241 "Invoke whatever scoring method we can." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1242 (interactive "P") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1243 (cond |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1244 ((or spam-use-spamassassin spam-use-spamassassin-headers) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1245 (spam-spamassassin-score recheck)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1246 ((or spam-use-bsfilter spam-use-bsfilter-headers) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1247 (spam-bsfilter-score recheck)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1248 (spam-use-crm114 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1249 (spam-crm114-score)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1250 (t (spam-bogofilter-score recheck)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1251 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1252 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1253 ;;{{{ set up widening, processor checks |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1254 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1255 ;;; set up IMAP widening if it's necessary |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1256 (defun spam-setup-widening () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1257 (when (spam-widening-needed-p) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1258 (setq nnimap-split-download-body-default t))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1259 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1260 (defun spam-widening-needed-p (&optional force-symbols) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1261 (let (found) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1262 (dolist (backend (spam-backend-list)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1263 (when (and (spam-backend-statistical-p backend) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1264 (or (symbol-value backend) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1265 (memq backend force-symbols))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1266 (setq found backend))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1267 found)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1268 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1269 (defvar spam-list-of-processors |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1270 ;; note the nil processors are not defined in gnus.el |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1271 '((gnus-group-spam-exit-processor-bogofilter spam spam-use-bogofilter) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1272 (gnus-group-spam-exit-processor-bsfilter spam spam-use-bsfilter) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1273 (gnus-group-spam-exit-processor-blacklist spam spam-use-blacklist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1274 (gnus-group-spam-exit-processor-ifile spam spam-use-ifile) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1275 (gnus-group-spam-exit-processor-stat spam spam-use-stat) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1276 (gnus-group-spam-exit-processor-spamoracle spam spam-use-spamoracle) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1277 (gnus-group-spam-exit-processor-spamassassin spam spam-use-spamassassin) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1278 (gnus-group-spam-exit-processor-report-gmane spam spam-use-gmane) ;; Buggy? |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1279 (gnus-group-ham-exit-processor-ifile ham spam-use-ifile) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1280 (gnus-group-ham-exit-processor-bogofilter ham spam-use-bogofilter) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1281 (gnus-group-ham-exit-processor-bsfilter ham spam-use-bsfilter) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1282 (gnus-group-ham-exit-processor-stat ham spam-use-stat) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1283 (gnus-group-ham-exit-processor-whitelist ham spam-use-whitelist) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1284 (gnus-group-ham-exit-processor-BBDB ham spam-use-BBDB) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1285 (gnus-group-ham-exit-processor-copy ham spam-use-ham-copy) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1286 (gnus-group-ham-exit-processor-spamassassin ham spam-use-spamassassin) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1287 (gnus-group-ham-exit-processor-spamoracle ham spam-use-spamoracle)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1288 "The OBSOLETE `spam-list-of-processors' list. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1289 This list contains pairs associating the obsolete ham/spam exit |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1290 processor variables with a classification and a spam-use-* |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1291 variable. When the processor variable is nil, just the |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1292 classification and spam-use-* check variable are used. This is |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1293 superseded by the new spam backend code, so it's only consulted |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1294 for backwards compatibility.") |
111067
e36c65ac23bf
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110918
diff
changeset
|
1295 (make-obsolete-variable 'spam-list-of-processors nil "22.1") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1296 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1297 (defun spam-group-processor-p (group backend &optional classification) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1298 "Checks if GROUP has a BACKEND with CLASSIFICATION registered. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1299 Also accepts the obsolete processors, which can be found in |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1300 gnus.el and in spam-list-of-processors. In the case of mover |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1301 backends, checks the setting of `spam-summary-exit-behavior' in |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1302 addition to the set values for the group." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1303 (if (and (stringp group) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1304 (symbolp backend)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1305 (let ((old-style (assq backend spam-list-of-processors)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1306 (parameters (nth 0 (gnus-parameter-spam-process group))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1307 found) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1308 (if old-style ; old-style processor |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1309 (spam-group-processor-p group (nth 2 old-style) (nth 1 old-style)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1310 ;; now search for the parameter |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1311 (dolist (parameter parameters) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1312 (when (and (null found) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1313 (listp parameter) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1314 (eq classification (nth 0 parameter)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1315 (eq backend (nth 1 parameter))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1316 (setq found t))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1317 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1318 ;; now, if the parameter was not found, do the |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1319 ;; spam-summary-exit-behavior-logic for mover backends |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1320 (unless found |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1321 (when (spam-backend-mover-p backend) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1322 (setq |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1323 found |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1324 (cond |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1325 ((eq spam-summary-exit-behavior 'move-all) t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1326 ((eq spam-summary-exit-behavior 'move-none) nil) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1327 ((eq spam-summary-exit-behavior 'default) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1328 (or (eq classification 'spam) ;move spam out of all groups |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1329 ;; move ham out of spam groups |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1330 (and (eq classification 'ham) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1331 (spam-group-spam-contents-p group)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1332 (t (gnus-error 5 "Unknown spam-summary-exit-behavior: %s" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1333 spam-summary-exit-behavior)))))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1334 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1335 found)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1336 nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1337 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1338 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1339 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1340 ;;{{{ Summary entry and exit processing. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1341 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1342 (defun spam-mark-junk-as-spam-routine () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1343 ;; check the global list of group names spam-junk-mailgroups and the |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1344 ;; group parameters |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1345 (when (spam-group-spam-contents-p gnus-newsgroup-name) |
69625
17473f7e626b
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-170
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1346 (gnus-message 6 "Marking %s articles as spam" |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1347 (if spam-mark-only-unseen-as-spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1348 "unseen" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1349 "unread")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1350 (let ((articles (if spam-mark-only-unseen-as-spam |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1351 gnus-newsgroup-unseen |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1352 gnus-newsgroup-unreads))) |
69625
17473f7e626b
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-170
Miles Bader <miles@gnu.org>
parents:
68633
diff
changeset
|
1353 (if spam-mark-new-messages-in-spam-group-as-spam |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1354 (dolist (article articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1355 (gnus-summary-mark-article article gnus-spam-mark)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1356 (gnus-message 9 "Did not mark new messages as spam."))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1357 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1358 (defun spam-summary-prepare () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1359 (setq spam-old-articles |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1360 (list (cons 'ham (spam-list-articles gnus-newsgroup-articles 'ham)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1361 (cons 'spam (spam-list-articles gnus-newsgroup-articles 'spam)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1362 (spam-mark-junk-as-spam-routine)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1363 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1364 ;; The spam processors are invoked for any group, spam or ham or neither |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1365 (defun spam-summary-prepare-exit () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1366 (unless gnus-group-is-exiting-without-update-p |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1367 (gnus-message 6 "Exiting summary buffer and applying spam rules") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1368 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1369 ;; before we begin, remove any article limits |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1370 ; (ignore-errors |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1371 ; (gnus-summary-pop-limit t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1372 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1373 ;; first of all, unregister any articles that are no longer ham or spam |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1374 ;; we have to iterate over the processors, or else we'll be too slow |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1375 (dolist (classification (spam-classifications)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1376 (let* ((old-articles (cdr-safe (assq classification spam-old-articles))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1377 (new-articles (spam-list-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1378 gnus-newsgroup-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1379 classification)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1380 (changed-articles (spam-set-difference new-articles old-articles))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1381 ;; now that we have the changed articles, we go through the processors |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1382 (dolist (backend (spam-backend-list)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1383 (let (unregister-list) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1384 (dolist (article changed-articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1385 (let ((id (spam-fetch-field-message-id-fast article))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1386 (when (spam-log-unregistration-needed-p |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1387 id 'process classification backend) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1388 (push article unregister-list)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1389 ;; call spam-register-routine with specific articles to unregister, |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1390 ;; when there are articles to unregister and the check is enabled |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1391 (when (and unregister-list (symbol-value backend)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1392 (spam-backend-put-article-todo-list backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1393 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1394 unregister-list |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1395 t)))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1396 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1397 ;; do the non-moving backends first, then the moving ones |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1398 (dolist (backend-type '(non-mover mover)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1399 (dolist (classification (spam-classifications)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1400 (dolist (backend (spam-backend-list backend-type)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1401 (when (spam-group-processor-p |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1402 gnus-newsgroup-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1403 backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1404 classification) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1405 (spam-backend-put-article-todo-list backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1406 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1407 (spam-list-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1408 gnus-newsgroup-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1409 classification)))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1410 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1411 (spam-resolve-registrations-routine) ; do the registrations now |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1412 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1413 ;; we mark all the leftover spam articles as expired at the end |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1414 (dolist (article (spam-list-articles |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1415 gnus-newsgroup-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1416 'spam)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1417 (gnus-summary-mark-article article gnus-expirable-mark))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1418 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1419 (setq spam-old-articles nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1420 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1421 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1422 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1423 ;;{{{ spam-use-move and spam-use-copy backend support functions |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1424 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1425 (defun spam-copy-or-move-routine (copy groups articles classification) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1426 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1427 (when (and (car-safe groups) (listp (car-safe groups))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1428 (setq groups (pop groups))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1429 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1430 (unless (listp groups) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1431 (setq groups (list groups))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1432 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1433 ;; remove the current process mark |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1434 (gnus-summary-kill-process-mark) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1435 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1436 (let ((backend-supports-deletions |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1437 (gnus-check-backend-function |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1438 'request-move-article gnus-newsgroup-name)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1439 (respool-method (gnus-find-method-for-group gnus-newsgroup-name)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1440 article mark deletep respool valid-move-destinations) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1441 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1442 (when (member 'respool groups) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1443 (setq respool t) ; boolean for later |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1444 (setq groups '("fake"))) ; when respooling, groups are dynamic so fake it |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1445 |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1446 ;; exclude invalid move destinations |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1447 (dolist (group groups) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1448 (unless |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1449 (or |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1450 (and |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1451 (eq classification 'spam) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1452 (spam-group-spam-contents-p gnus-newsgroup-name) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1453 (spam-group-spam-contents-p group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1454 (gnus-message |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1455 3 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1456 "Sorry, can't move spam from spam group %s to spam group %s" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1457 gnus-newsgroup-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1458 group)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1459 (and |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1460 (eq classification 'ham) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1461 (spam-group-ham-contents-p gnus-newsgroup-name) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1462 (spam-group-ham-contents-p group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1463 (gnus-message |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1464 3 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1465 "Sorry, can't move ham from ham group %s to ham group %s" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1466 gnus-newsgroup-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1467 group))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1468 (push group valid-move-destinations))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1469 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1470 (setq groups (nreverse valid-move-destinations)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1471 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1472 ;; now do the actual move |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1473 (dolist (group groups) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1474 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1475 (when (and articles (stringp group)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1476 |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1477 ;; first, mark the article with the process mark and, if needed, |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1478 ;; the unread or expired mark (for ham and spam respectively) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1479 (dolist (article articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1480 (when (and (eq classification 'ham) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1481 spam-mark-ham-unread-before-move-from-spam-group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1482 (gnus-message 9 "Marking ham article %d unread before move" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1483 article) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1484 (gnus-summary-mark-article article gnus-unread-mark)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1485 (when (and (eq classification 'spam) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1486 (not copy)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1487 (gnus-message 9 "Marking spam article %d expirable before move" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1488 article) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1489 (gnus-summary-mark-article article gnus-expirable-mark)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1490 (gnus-summary-set-process-mark article) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1491 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1492 (if respool ; respooling is with a "fake" group |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1493 (let ((spam-split-disabled |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1494 (or spam-split-disabled |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1495 (and (eq classification 'ham) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1496 spam-disable-spam-split-during-ham-respool)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1497 (gnus-message 9 "Respooling article %d with method %s" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1498 article respool-method) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1499 (gnus-summary-respool-article nil respool-method)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1500 ;; else, we are not respooling |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1501 (if (or (not backend-supports-deletions) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1502 (> (length groups) 1)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1503 (progn ; if copying, copy and set deletep |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1504 (gnus-message 9 "Copying article %d to group %s" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1505 article group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1506 (gnus-summary-copy-article nil group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1507 (setq deletep t)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1508 (gnus-message 9 "Moving article %d to group %s" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1509 article group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1510 (gnus-summary-move-article nil group)))))) ; else move articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1511 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1512 ;; now delete the articles, unless a) copy is t, and there was a copy done |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1513 ;; b) a move was done to a single group |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1514 ;; c) backend-supports-deletions is nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1515 (unless copy |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1516 (when (and deletep backend-supports-deletions) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1517 (dolist (article articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1518 (gnus-summary-set-process-mark article) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1519 (gnus-message 9 "Deleting article %d" article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1520 (when articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1521 (let ((gnus-novice-user nil)) ; don't ask me if I'm sure |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1522 (gnus-summary-delete-article nil))))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1523 (gnus-summary-yank-process-mark) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1524 (length articles))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1525 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1526 (defun spam-copy-spam-routine (articles) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1527 (spam-copy-or-move-routine |
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1528 t |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1529 (gnus-parameter-spam-process-destination gnus-newsgroup-name) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1530 articles |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1531 'spam)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1532 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1533 (defun spam-move-spam-routine (articles) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1534 (spam-copy-or-move-routine |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1535 nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1536 (gnus-parameter-spam-process-destination gnus-newsgroup-name) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1537 articles |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1538 'spam)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1539 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1540 (defun spam-copy-ham-routine (articles) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1541 (spam-copy-or-move-routine |
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1542 t |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1543 (gnus-parameter-ham-process-destination gnus-newsgroup-name) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1544 articles |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1545 'ham)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1546 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1547 (defun spam-move-ham-routine (articles) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1548 (spam-copy-or-move-routine |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1549 nil |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1550 (gnus-parameter-ham-process-destination gnus-newsgroup-name) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1551 articles |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1552 'ham)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1553 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1554 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1555 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1556 ;;{{{ article and field retrieval code |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1557 (defun spam-get-article-as-string (article) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1558 (when (numberp article) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1559 (with-temp-buffer |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1560 (gnus-request-article-this-buffer |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1561 article |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1562 gnus-newsgroup-name) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1563 (buffer-string)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1564 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1565 ;; disabled for now |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1566 ;; (defun spam-get-article-as-filename (article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1567 ;; (let ((article-filename)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1568 ;; (when (numberp article) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1569 ;; (nnml-possibly-change-directory |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1570 ;; (gnus-group-real-name gnus-newsgroup-name)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1571 ;; (setq article-filename (expand-file-name |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1572 ;; (int-to-string article) nnml-current-directory))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1573 ;; (if (file-exists-p article-filename) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1574 ;; article-filename |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1575 ;; nil))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1576 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1577 (defun spam-fetch-field-fast (article field &optional prepared-data-header) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1578 "Fetch a FIELD for ARTICLE with the internal `gnus-data-list' function. |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1579 When PREPARED-DATA-HEADER is given, don't look in the Gnus data. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1580 When FIELD is 'number, ARTICLE can be any number (since we want |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1581 to find it out)." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1582 (when (numberp article) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1583 (let* ((data-header (or prepared-data-header |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1584 (spam-fetch-article-header article)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1585 (if (arrayp data-header) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1586 (cond |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1587 ((equal field 'number) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1588 (mail-header-number data-header)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1589 ((equal field 'from) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1590 (mail-header-from data-header)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1591 ((equal field 'message-id) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1592 (mail-header-message-id data-header)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1593 ((equal field 'subject) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1594 (mail-header-subject data-header)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1595 ((equal field 'references) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1596 (mail-header-references data-header)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1597 ((equal field 'date) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1598 (mail-header-date data-header)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1599 ((equal field 'xref) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1600 (mail-header-xref data-header)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1601 ((equal field 'extra) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1602 (mail-header-extra data-header)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1603 (t |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1604 (gnus-error |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1605 5 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1606 "spam-fetch-field-fast: unknown field %s requested" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1607 field) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1608 nil)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1609 (gnus-message 6 "Article %d has a nil data header" article))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1610 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1611 (defun spam-fetch-field-from-fast (article &optional prepared-data-header) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1612 (spam-fetch-field-fast article 'from prepared-data-header)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1613 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1614 (defun spam-fetch-field-subject-fast (article &optional prepared-data-header) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1615 (spam-fetch-field-fast article 'subject prepared-data-header)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1616 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1617 (defun spam-fetch-field-message-id-fast (article &optional prepared-data-header) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1618 (spam-fetch-field-fast article 'message-id prepared-data-header)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1619 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1620 (defun spam-generate-fake-headers (article) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1621 (let ((dh (spam-fetch-article-header article))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1622 (if dh |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1623 (concat |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1624 (format |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1625 ;; 80-character limit makes for strange constructs |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1626 (concat "From: %s\nSubject: %s\nMessage-ID: %s\n" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1627 "Date: %s\nReferences: %s\nXref: %s\n") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1628 (spam-fetch-field-fast article 'from dh) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1629 (spam-fetch-field-fast article 'subject dh) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1630 (spam-fetch-field-fast article 'message-id dh) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1631 (spam-fetch-field-fast article 'date dh) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1632 (spam-fetch-field-fast article 'references dh) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1633 (spam-fetch-field-fast article 'xref dh)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1634 (when (spam-fetch-field-fast article 'extra dh) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1635 (format "%s\n" (spam-fetch-field-fast article 'extra dh)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1636 (gnus-message |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1637 5 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1638 "spam-generate-fake-headers: article %d didn't have a valid header" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1639 article)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1640 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1641 (defun spam-fetch-article-header (article) |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
1642 (with-current-buffer gnus-summary-buffer |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1643 (gnus-read-header article) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1644 (nth 3 (assq article gnus-newsgroup-data)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1645 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1646 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1647 ;;{{{ Spam determination. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1648 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1649 (defun spam-split (&rest specific-checks) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1650 "Split this message into the `spam' group if it is spam. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1651 This function can be used as an entry in the variable `nnmail-split-fancy', |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1652 for example like this: (: spam-split). It can take checks as |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1653 parameters. A string as a parameter will set the |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1654 `spam-split-group' to that string. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1655 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1656 See the Info node `(gnus)Fancy Mail Splitting' for more details." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1657 (interactive) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1658 (setq spam-split-last-successful-check nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1659 (unless spam-split-disabled |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1660 (let ((spam-split-group-choice spam-split-group)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1661 (dolist (check specific-checks) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1662 (when (stringp check) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1663 (setq spam-split-group-choice check) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1664 (setq specific-checks (delq check specific-checks)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1665 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1666 (let ((spam-split-group spam-split-group-choice) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1667 (widening-needed-check (spam-widening-needed-p specific-checks))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1668 (save-excursion |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1669 (save-restriction |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1670 (when widening-needed-check |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1671 (widen) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1672 (gnus-message 8 "spam-split: widening the buffer (%s requires it)" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1673 widening-needed-check)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1674 (let ((backends (spam-backend-list)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1675 decision) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1676 (while (and backends (not decision)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1677 (let* ((backend (pop backends)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1678 (check-function (spam-backend-check backend)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1679 (spam-split-group (if spam-split-symbolic-return |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1680 'spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1681 spam-split-group))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1682 (when (or |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1683 ;; either, given specific checks, this is one of them |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1684 (memq backend specific-checks) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1685 ;; or, given no specific checks, spam-use-CHECK is set |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1686 (and (null specific-checks) (symbol-value backend))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1687 (gnus-message 6 "spam-split: calling the %s function" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1688 check-function) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1689 (setq decision (funcall check-function)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1690 ;; if we got a decision at all, save the current check |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1691 (when decision |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1692 (setq spam-split-last-successful-check backend)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1693 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1694 (when (eq decision 'spam) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1695 (unless spam-split-symbolic-return |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1696 (gnus-error |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1697 5 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1698 (format "spam-split got %s but %s is nil" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1699 decision |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1700 spam-split-symbolic-return))))))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1701 (if (eq decision t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1702 (if spam-split-symbolic-return-positive 'ham nil) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1703 decision)))))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1704 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1705 (defun spam-find-spam () |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1706 "Detect spam in the current newsgroup using `spam-split'." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1707 (interactive) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1708 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1709 (let* ((group gnus-newsgroup-name) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1710 (autodetect (gnus-parameter-spam-autodetect group)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1711 (methods (gnus-parameter-spam-autodetect-methods group)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1712 (first-method (nth 0 methods)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1713 (articles (if spam-autodetect-recheck-messages |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1714 gnus-newsgroup-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1715 gnus-newsgroup-unseen)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1716 article-cannot-be-faked) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1717 |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
1718 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1719 (dolist (backend methods) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1720 (when (spam-backend-statistical-p backend) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1721 (setq article-cannot-be-faked t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1722 (return))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1723 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1724 (when (memq 'default methods) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1725 (setq article-cannot-be-faked t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1726 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1727 (when (and autodetect |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1728 (not (equal first-method 'none))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1729 (mapcar |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1730 (lambda (article) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1731 (let ((id (spam-fetch-field-message-id-fast article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1732 (subject (spam-fetch-field-subject-fast article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1733 (sender (spam-fetch-field-from-fast article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1734 registry-lookup) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1735 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1736 (unless id |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1737 (gnus-message 6 "Article %d has no message ID!" article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1738 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1739 (when (and id spam-log-to-registry) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1740 (setq registry-lookup (spam-log-registration-type id 'incoming)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1741 (when registry-lookup |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1742 (gnus-message |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1743 9 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1744 "spam-find-spam: message %s was already registered incoming" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1745 id))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1746 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1747 (let* ((spam-split-symbolic-return t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1748 (spam-split-symbolic-return-positive t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1749 (fake-headers (spam-generate-fake-headers article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1750 (split-return |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1751 (or registry-lookup |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1752 (with-temp-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1753 (if article-cannot-be-faked |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1754 (gnus-request-article-this-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1755 article |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1756 group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1757 ;; else, we fake the article |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1758 (when fake-headers (insert fake-headers))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1759 (if (or (null first-method) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1760 (equal first-method 'default)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1761 (spam-split) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1762 (apply 'spam-split methods)))))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1763 (if (equal split-return 'spam) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1764 (gnus-summary-mark-article article gnus-spam-mark)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1765 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1766 (when (and id split-return spam-log-to-registry) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1767 (when (zerop (gnus-registry-group-count id)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1768 (gnus-registry-add-group |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1769 id group subject sender)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1770 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1771 (unless registry-lookup |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1772 (spam-log-processing-to-registry |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1773 id |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1774 'incoming |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1775 split-return |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1776 spam-split-last-successful-check |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1777 group)))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1778 articles)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1779 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1780 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1781 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1782 ;;{{{ registration/unregistration functions |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1783 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1784 (defun spam-resolve-registrations-routine () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1785 "Go through the backends and register or unregister articles as needed." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1786 (dolist (backend-type '(non-mover mover)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1787 (dolist (classification (spam-classifications)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1788 (dolist (backend (spam-backend-list backend-type)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1789 (let ((rlist (spam-backend-get-article-todo-list |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1790 backend classification)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1791 (ulist (spam-backend-get-article-todo-list |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1792 backend classification t)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1793 (delcount 0)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1794 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1795 ;; clear the old lists right away |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1796 (spam-backend-put-article-todo-list backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1797 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1798 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1799 nil) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1800 (spam-backend-put-article-todo-list backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1801 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1802 nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1803 t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1804 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1805 ;; eliminate duplicates |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1806 (dolist (article (copy-sequence ulist)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1807 (when (memq article rlist) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1808 (incf delcount) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1809 (setq rlist (delq article rlist)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1810 (setq ulist (delq article ulist)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1811 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1812 (unless (zerop delcount) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1813 (gnus-message |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1814 9 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1815 "%d messages did not have to unregister and then register" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1816 delcount)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1817 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1818 ;; unregister articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1819 (unless (zerop (length ulist)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1820 (let ((num (spam-unregister-routine classification backend ulist))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1821 (when (> num 0) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1822 (gnus-message |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1823 6 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1824 "%d %s messages were unregistered by backend %s." |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1825 num |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1826 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1827 backend)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1828 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1829 ;; register articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1830 (unless (zerop (length rlist)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1831 (let ((num (spam-register-routine classification backend rlist))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1832 (when (> num 0) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1833 (gnus-message |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1834 6 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1835 "%d %s messages were registered by backend %s." |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1836 num |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1837 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1838 backend))))))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1839 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1840 (defun spam-unregister-routine (classification |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1841 backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1842 specific-articles) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1843 (spam-register-routine classification backend specific-articles t)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1844 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1845 (defun spam-register-routine (classification |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1846 backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1847 specific-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1848 &optional unregister) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1849 (when (and (spam-classification-valid-p classification) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1850 (spam-backend-valid-p backend)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1851 (let* ((register-function |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1852 (spam-backend-function backend classification 'registration)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1853 (unregister-function |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1854 (spam-backend-function backend classification 'unregistration)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1855 (run-function (if unregister |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1856 unregister-function |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1857 register-function)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1858 (log-function (if unregister |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1859 'spam-log-undo-registration |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1860 'spam-log-processing-to-registry)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1861 article articles) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1862 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1863 (when run-function |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1864 ;; make list of articles, using specific-articles if given |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1865 (setq articles (or specific-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1866 (spam-list-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1867 gnus-newsgroup-articles |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1868 classification))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1869 ;; process them |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1870 (when (> (length articles) 0) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1871 (gnus-message 5 "%s %d %s articles as %s using backend %s" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1872 (if unregister "Unregistering" "Registering") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1873 (length articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1874 (if specific-articles "specific" "") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1875 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1876 backend) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1877 (funcall run-function articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1878 ;; now log all the registrations (or undo them, depending on |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1879 ;; unregister) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1880 (dolist (article articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1881 (funcall log-function |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1882 (spam-fetch-field-message-id-fast article) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1883 'process |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1884 classification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1885 backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1886 gnus-newsgroup-name)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1887 ;; return the number of articles processed |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1888 (length articles)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1889 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1890 ;;; log a ham- or spam-processor invocation to the registry |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1891 (defun spam-log-processing-to-registry (id type classification backend group) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1892 (when spam-log-to-registry |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1893 (if (and (stringp id) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1894 (stringp group) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1895 (spam-process-type-valid-p type) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1896 (spam-classification-valid-p classification) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1897 (spam-backend-valid-p backend)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1898 (let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1899 (cell (list classification backend group))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1900 (push cell cell-list) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1901 (gnus-registry-store-extra-entry |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1902 id |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1903 type |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1904 cell-list)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1905 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1906 (gnus-error |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1907 7 |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1908 (format |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1909 "%s call with bad ID, type, classification, spam-backend, or group" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1910 "spam-log-processing-to-registry"))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1911 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1912 ;;; check if a ham- or spam-processor registration has been done |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1913 (defun spam-log-registered-p (id type) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1914 (when spam-log-to-registry |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1915 (if (and (stringp id) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1916 (spam-process-type-valid-p type)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1917 (cdr-safe (gnus-registry-fetch-extra id type)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1918 (progn |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1919 (gnus-error |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1920 7 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1921 (format "%s called with bad ID, type, classification, or spam-backend" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1922 "spam-log-registered-p")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1923 nil)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1924 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1925 ;;; check what a ham- or spam-processor registration says |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1926 ;;; returns nil if conflicting registrations are found |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1927 (defun spam-log-registration-type (id type) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1928 (let ((count 0) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1929 decision) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1930 (dolist (reg (spam-log-registered-p id type)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1931 (let ((classification (nth 0 reg))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1932 (when (spam-classification-valid-p classification) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1933 (when (and decision |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1934 (not (eq classification decision))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1935 (setq count (+ 1 count))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1936 (setq decision classification)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1937 (if (< 0 count) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1938 nil |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1939 decision))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1940 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1941 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1942 ;;; check if a ham- or spam-processor registration needs to be undone |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1943 (defun spam-log-unregistration-needed-p (id type classification backend) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1944 (when spam-log-to-registry |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1945 (if (and (stringp id) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1946 (spam-process-type-valid-p type) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1947 (spam-classification-valid-p classification) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1948 (spam-backend-valid-p backend)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1949 (let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1950 found) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1951 (dolist (cell cell-list) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1952 (unless found |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1953 (when (and (eq classification (nth 0 cell)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1954 (eq backend (nth 1 cell))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1955 (setq found t)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1956 found) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1957 (progn |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1958 (gnus-error |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1959 7 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1960 (format "%s called with bad ID, type, classification, or spam-backend" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1961 "spam-log-unregistration-needed-p")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1962 nil)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1963 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1964 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1965 ;;; undo a ham- or spam-processor registration (the group is not used) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1966 (defun spam-log-undo-registration (id type classification backend |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1967 &optional group) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1968 (when (and spam-log-to-registry |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1969 (spam-log-unregistration-needed-p id type classification backend)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1970 (if (and (stringp id) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1971 (spam-process-type-valid-p type) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1972 (spam-classification-valid-p classification) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1973 (spam-backend-valid-p backend)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1974 (let ((cell-list (cdr-safe (gnus-registry-fetch-extra id type))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1975 new-cell-list found) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1976 (dolist (cell cell-list) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1977 (unless (and (eq classification (nth 0 cell)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1978 (eq backend (nth 1 cell))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1979 (push cell new-cell-list))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1980 (gnus-registry-store-extra-entry |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1981 id |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1982 type |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1983 new-cell-list)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1984 (progn |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1985 (gnus-error 7 (format |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1986 "%s call with bad ID, type, spam-backend, or group" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1987 "spam-log-undo-registration")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1988 nil)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
1989 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1990 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1991 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1992 ;;{{{ backend functions |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1993 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1994 ;;{{{ Gmane xrefs |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1995 (defun spam-check-gmane-xref () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
1996 (let ((header (or |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1997 (message-fetch-field "Xref") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1998 (message-fetch-field "Newsgroups")))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
1999 (when header ; return nil when no header |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2000 (when (string-match spam-gmane-xref-spam-group |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2001 header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2002 spam-split-group)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2003 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2004 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2005 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2006 ;;{{{ Regex body |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2007 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2008 (defun spam-check-regex-body () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2009 (let ((spam-regex-headers-ham spam-regex-body-ham) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2010 (spam-regex-headers-spam spam-regex-body-spam)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2011 (spam-check-regex-headers t))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2012 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2013 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2014 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2015 ;;{{{ Regex headers |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2016 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2017 (defun spam-check-regex-headers (&optional body) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2018 (let ((type (if body "body" "header")) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2019 ret found) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2020 (dolist (h-regex spam-regex-headers-ham) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2021 (unless found |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2022 (goto-char (point-min)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2023 (when (re-search-forward h-regex nil t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2024 (message "Ham regex %s search positive." type) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2025 (setq found t)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2026 (dolist (s-regex spam-regex-headers-spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2027 (unless found |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2028 (goto-char (point-min)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2029 (when (re-search-forward s-regex nil t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2030 (message "Spam regex %s search positive." type) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2031 (setq found t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2032 (setq ret spam-split-group)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2033 ret)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2034 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2035 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2036 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2037 ;;{{{ Blackholes. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2038 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2039 (defun spam-reverse-ip-string (ip) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2040 (when (stringp ip) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2041 (mapconcat 'identity |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2042 (nreverse (split-string ip "\\.")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2043 "."))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2044 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2045 (defun spam-check-blackholes () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2046 "Check the Received headers for blackholed relays." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2047 (let ((headers (message-fetch-field "received")) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2048 ips matches) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2049 (when headers |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2050 (with-temp-buffer |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2051 (insert headers) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2052 (goto-char (point-min)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2053 (gnus-message 6 "Checking headers for relay addresses") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2054 (while (re-search-forward |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2055 "\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2056 (gnus-message 9 "Blackhole search found host IP %s." (match-string 1)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2057 (push (spam-reverse-ip-string (match-string 1)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2058 ips))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2059 (dolist (server spam-blackhole-servers) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2060 (dolist (ip ips) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2061 (unless (and spam-blackhole-good-server-regex |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2062 ;; match against the reversed (again) IP string |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2063 (string-match |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2064 spam-blackhole-good-server-regex |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2065 (spam-reverse-ip-string ip))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2066 (unless matches |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2067 (let ((query-string (concat ip "." server))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2068 (if spam-use-dig |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2069 (let ((query-result (query-dig query-string))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2070 (when query-result |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2071 (gnus-message 6 "(DIG): positive blackhole check '%s'" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2072 query-result) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2073 (push (list ip server query-result) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2074 matches))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2075 ;; else, if not using dig.el |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2076 (when (dns-query query-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2077 (gnus-message 6 "positive blackhole check") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2078 (push (list ip server (dns-query query-string 'TXT)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2079 matches))))))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2080 (when matches |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2081 spam-split-group))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2082 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2083 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2084 ;;{{{ Hashcash. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2085 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2086 (defun spam-check-hashcash () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2087 "Check the headers for hashcash payments." |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2088 (ignore-errors (mail-check-payment))) ;mail-check-payment returns a boolean |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2089 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2090 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2091 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2092 ;;{{{ BBDB |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2093 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2094 ;;; original idea for spam-check-BBDB from Alexander Kotelnikov |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2095 ;;; <sacha@giotto.sj.ru> |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2096 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2097 ;; all this is done inside a condition-case to trap errors |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2098 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2099 (eval-when-compile |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2100 (autoload 'bbdb-buffer "bbdb") |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2101 (autoload 'bbdb-create-internal "bbdb") |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2102 (autoload 'bbdb-search-simple "bbdb")) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2103 |
87226
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
2104 ;; Autoloaded in message, which we require. |
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
2105 (declare-function gnus-extract-address-components "gnus-util" (from)) |
8088d508b758
Move `require's before `eval-when-compile's.
Glenn Morris <rgm@gnu.org>
parents:
86328
diff
changeset
|
2106 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2107 (eval-and-compile |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2108 (when (condition-case nil |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2109 (progn |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2110 (require 'bbdb) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2111 (require 'bbdb-com)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2112 (file-error |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2113 ;; `bbdb-records' should not be bound as an autoload function |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2114 ;; before loading bbdb because of `bbdb-hashtable-size'. |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2115 (defalias 'bbdb-records 'ignore) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2116 (defalias 'spam-BBDB-register-routine 'ignore) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2117 (defalias 'spam-enter-ham-BBDB 'ignore) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2118 nil)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2119 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2120 ;; when the BBDB changes, we want to clear out our cache |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2121 (defun spam-clear-cache-BBDB (&rest immaterial) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2122 (spam-clear-cache 'spam-use-BBDB)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2123 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2124 (add-hook 'bbdb-change-hook 'spam-clear-cache-BBDB) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2125 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2126 (defun spam-enter-ham-BBDB (addresses &optional remove) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2127 "Enter an address into the BBDB; implies ham (non-spam) sender" |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2128 (dolist (from addresses) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2129 (when (stringp from) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2130 (let* ((parsed-address (gnus-extract-address-components from)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2131 (name (or (nth 0 parsed-address) "Ham Sender")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2132 (remove-function (if remove |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2133 'bbdb-delete-record-internal |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2134 'ignore)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2135 (net-address (nth 1 parsed-address)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2136 (record (and net-address |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2137 (bbdb-search-simple nil net-address)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2138 (when net-address |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2139 (gnus-message 6 "%s address %s %s BBDB" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2140 (if remove "Deleting" "Adding") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2141 from |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2142 (if remove "from" "to")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2143 (if record |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2144 (funcall remove-function record) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2145 (bbdb-create-internal name nil net-address nil nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2146 "ham sender added by spam.el"))))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2147 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2148 (defun spam-BBDB-register-routine (articles &optional unregister) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2149 (let (addresses) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2150 (dolist (article articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2151 (when (stringp (spam-fetch-field-from-fast article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2152 (push (spam-fetch-field-from-fast article) addresses))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2153 ;; now do the register/unregister action |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2154 (spam-enter-ham-BBDB addresses unregister))) |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2155 |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2156 (defun spam-BBDB-unregister-routine (articles) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2157 (spam-BBDB-register-routine articles t)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2158 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2159 (defun spam-check-BBDB () |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2160 "Mail from people in the BBDB is classified as ham or non-spam" |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2161 (let ((who (message-fetch-field "from")) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2162 bbdb-cache bbdb-hashtable) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2163 (when spam-cache-lookups |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2164 (setq bbdb-cache (gethash 'spam-use-BBDB spam-caches)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2165 (unless bbdb-cache |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2166 (setq bbdb-cache (make-vector 17 0)) ; a good starting hash value |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2167 ;; this is based on the expanded (bbdb-hashtable) macro |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2168 ;; without the debugging support |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2169 (with-current-buffer (bbdb-buffer) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2170 (save-excursion |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2171 (save-window-excursion |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2172 (bbdb-records nil t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2173 (mapatoms |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2174 (lambda (symbol) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2175 (intern (downcase (symbol-name symbol)) bbdb-cache)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2176 bbdb-hashtable)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2177 (puthash 'spam-use-BBDB bbdb-cache spam-caches))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2178 (when who |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2179 (setq who (nth 1 (gnus-extract-address-components who))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2180 (if |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2181 (if spam-cache-lookups |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2182 (intern-soft (downcase who) bbdb-cache) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2183 (bbdb-search-simple nil who)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2184 t |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2185 (if spam-use-BBDB-exclusive |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2186 spam-split-group |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2187 nil))))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2188 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2189 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2190 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2191 ;;{{{ ifile |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2192 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2193 ;;; check the ifile backend; return nil if the mail was NOT classified |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2194 ;;; as spam |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2195 |
74984 | 2196 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2197 (defun spam-get-ifile-database-parameter () |
74984 | 2198 "Return the command-line parameter for ifile's database. |
2199 See `spam-ifile-database'." | |
2200 (if spam-ifile-database | |
2201 (format "--db-file=%s" spam-ifile-database) | |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2202 nil)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2203 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2204 (defun spam-check-ifile () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2205 "Check the ifile backend for the classification of this message." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2206 (let ((article-buffer-name (buffer-name)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2207 category return) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2208 (with-temp-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2209 (let ((temp-buffer-name (buffer-name)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2210 (db-param (spam-get-ifile-database-parameter))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2211 (with-current-buffer article-buffer-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2212 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2213 (point-min) (point-max) spam-ifile-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2214 nil temp-buffer-name nil "-c" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2215 (if db-param `(,db-param "-q") `("-q")))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2216 ;; check the return now (we're back in the temp buffer) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2217 (goto-char (point-min)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2218 (if (not (eobp)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2219 (setq category (buffer-substring (point) (point-at-eol)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2220 (when (not (zerop (length category))) ; we need a category here |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2221 (if spam-ifile-all-categories |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2222 (setq return category) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2223 ;; else, if spam-ifile-all-categories is not set... |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2224 (when (string-equal spam-ifile-spam-category category) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2225 (setq return spam-split-group)))))) ; note return is nil otherwise |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2226 return)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2227 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2228 (defun spam-ifile-register-with-ifile (articles category &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2229 "Register an article, given as a string, with a category. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2230 Uses `gnus-newsgroup-name' if category is nil (for ham registration)." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2231 (let ((category (or category gnus-newsgroup-name)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2232 (add-or-delete-option (if unregister "-d" "-i")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2233 (db (spam-get-ifile-database-parameter)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2234 parameters) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2235 (with-temp-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2236 (dolist (article articles) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2237 (let ((article-string (spam-get-article-as-string article))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2238 (when (stringp article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2239 (insert article-string)))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2240 (apply 'call-process-region |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2241 (point-min) (point-max) spam-ifile-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2242 nil nil nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2243 add-or-delete-option category |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2244 (if db `(,db "-h") `("-h")))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2245 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2246 (defun spam-ifile-register-spam-routine (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2247 (spam-ifile-register-with-ifile articles spam-ifile-spam-category unregister)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2248 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2249 (defun spam-ifile-unregister-spam-routine (articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2250 (spam-ifile-register-spam-routine articles t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2251 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2252 (defun spam-ifile-register-ham-routine (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2253 (spam-ifile-register-with-ifile articles spam-ifile-ham-category unregister)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2254 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2255 (defun spam-ifile-unregister-ham-routine (articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2256 (spam-ifile-register-ham-routine articles t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2257 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2258 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2259 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2260 ;;{{{ spam-stat |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2261 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2262 (eval-when-compile |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2263 (autoload 'spam-stat-buffer-change-to-non-spam "spam-stat") |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2264 (autoload 'spam-stat-buffer-change-to-spam "spam-stat") |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2265 (autoload 'spam-stat-buffer-is-non-spam "spam-stat") |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2266 (autoload 'spam-stat-buffer-is-spam "spam-stat") |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2267 (autoload 'spam-stat-load "spam-stat") |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2268 (autoload 'spam-stat-save "spam-stat") |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2269 (autoload 'spam-stat-split-fancy "spam-stat")) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2270 |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2271 (eval-and-compile |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2272 (when (condition-case nil |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2273 (let ((spam-stat-install-hooks nil)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2274 (require 'spam-stat)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2275 (file-error |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2276 (defalias 'spam-stat-register-ham-routine 'ignore) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2277 (defalias 'spam-stat-register-spam-routine 'ignore) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2278 nil)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2279 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2280 (defun spam-check-stat () |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2281 "Check the spam-stat backend for the classification of this message" |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2282 (let ((spam-stat-split-fancy-spam-group spam-split-group) ; override |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2283 (spam-stat-buffer (buffer-name)) ; stat the current buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2284 category return) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2285 (spam-stat-split-fancy))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2286 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2287 (defun spam-stat-register-spam-routine (articles &optional unregister) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2288 (dolist (article articles) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2289 (let ((article-string (spam-get-article-as-string article))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2290 (with-temp-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2291 (insert article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2292 (if unregister |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2293 (spam-stat-buffer-change-to-non-spam) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2294 (spam-stat-buffer-is-spam)))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2295 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2296 (defun spam-stat-unregister-spam-routine (articles) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2297 (spam-stat-register-spam-routine articles t)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2298 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2299 (defun spam-stat-register-ham-routine (articles &optional unregister) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2300 (dolist (article articles) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2301 (let ((article-string (spam-get-article-as-string article))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2302 (with-temp-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2303 (insert article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2304 (if unregister |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2305 (spam-stat-buffer-change-to-spam) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2306 (spam-stat-buffer-is-non-spam)))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2307 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2308 (defun spam-stat-unregister-ham-routine (articles) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2309 (spam-stat-register-ham-routine articles t)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2310 |
58835
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2311 (defun spam-maybe-spam-stat-load () |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2312 (when spam-use-stat (spam-stat-load))) |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2313 |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2314 (defun spam-maybe-spam-stat-save () |
9bdd97960431
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-716
Miles Bader <miles@gnu.org>
parents:
57931
diff
changeset
|
2315 (when spam-use-stat (spam-stat-save))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2316 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2317 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2318 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2319 ;;{{{ Blacklists and whitelists. |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2320 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2321 (defvar spam-whitelist-cache nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2322 (defvar spam-blacklist-cache nil) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2323 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2324 (defun spam-kill-whole-line () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2325 (beginning-of-line) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2326 (let ((kill-whole-line t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2327 (kill-line))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2328 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2329 ;;; address can be a list, too |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2330 (defun spam-enter-whitelist (address &optional remove) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2331 "Enter ADDRESS (list or single) into the whitelist. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2332 With a non-nil REMOVE, remove them." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2333 (interactive "sAddress: ") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2334 (spam-enter-list address spam-whitelist remove) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2335 (setq spam-whitelist-cache nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2336 (spam-clear-cache 'spam-use-whitelist)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2337 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2338 ;;; address can be a list, too |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2339 (defun spam-enter-blacklist (address &optional remove) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2340 "Enter ADDRESS (list or single) into the blacklist. |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2341 With a non-nil REMOVE, remove them." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2342 (interactive "sAddress: ") |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2343 (spam-enter-list address spam-blacklist remove) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2344 (setq spam-blacklist-cache nil) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2345 (spam-clear-cache 'spam-use-whitelist)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2346 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2347 (defun spam-enter-list (addresses file &optional remove) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2348 "Enter ADDRESSES into the given FILE. |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2349 Either the whitelist or the blacklist files can be used. |
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2350 With a non-nil REMOVE, remove the ADDRESSES." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2351 (if (stringp addresses) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2352 (spam-enter-list (list addresses) file remove) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2353 ;; else, we have a list of addresses here |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2354 (unless (file-exists-p (file-name-directory file)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2355 (make-directory (file-name-directory file) t)) |
110410
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
2356 (with-current-buffer |
f2e111723c3a
Merge changes made in Gnus trunk.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
110102
diff
changeset
|
2357 (find-file-noselect file) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2358 (dolist (a addresses) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2359 (when (stringp a) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2360 (goto-char (point-min)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2361 (if (re-search-forward (regexp-quote a) nil t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2362 ;; found the address |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2363 (when remove |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2364 (spam-kill-whole-line)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2365 ;; else, the address was not found |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2366 (unless remove |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2367 (goto-char (point-max)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2368 (unless (bobp) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2369 (insert "\n")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2370 (insert a "\n"))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2371 (save-buffer)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2372 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2373 (defun spam-filelist-build-cache (type) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2374 (let ((cache (if (eq type 'spam-use-blacklist) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2375 spam-blacklist-cache |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2376 spam-whitelist-cache)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2377 parsed-cache) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2378 (unless (gethash type spam-caches) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2379 (while cache |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2380 (let ((address (pop cache))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2381 (unless (zerop (length address)) ; 0 for a nil address too |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2382 (setq address (regexp-quote address)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2383 ;; fix regexp-quote's treatment of user-intended regexes |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2384 (while (string-match "\\\\\\*" address) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2385 (setq address (replace-match ".*" t t address)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2386 (push address parsed-cache))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2387 (puthash type parsed-cache spam-caches)))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2388 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2389 (defun spam-filelist-check-cache (type from) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2390 (when (stringp from) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2391 (spam-filelist-build-cache type) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2392 (let (found) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2393 (dolist (address (gethash type spam-caches)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2394 (when (and address (string-match address from)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2395 (setq found t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2396 (return))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2397 found))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2398 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2399 ;;; returns t if the sender is in the whitelist, nil or |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2400 ;;; spam-split-group otherwise |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2401 (defun spam-check-whitelist () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2402 ;; FIXME! Should it detect when file timestamps change? |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2403 (unless spam-whitelist-cache |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2404 (setq spam-whitelist-cache (spam-parse-list spam-whitelist))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2405 (if (spam-from-listed-p 'spam-use-whitelist) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2406 t |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2407 (if spam-use-whitelist-exclusive |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2408 spam-split-group |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2409 nil))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2410 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2411 (defun spam-check-blacklist () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2412 ;; FIXME! Should it detect when file timestamps change? |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2413 (unless spam-blacklist-cache |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2414 (setq spam-blacklist-cache (spam-parse-list spam-blacklist))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2415 (and (spam-from-listed-p 'spam-use-blacklist) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2416 spam-split-group)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2417 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2418 (defun spam-parse-list (file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2419 (when (file-readable-p file) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2420 (let (contents address) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2421 (with-temp-buffer |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2422 (insert-file-contents file) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2423 (while (not (eobp)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2424 (setq address (buffer-substring (point) (point-at-eol))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2425 (forward-line 1) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2426 ;; insert the e-mail address if detected, otherwise the raw data |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2427 (unless (zerop (length address)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2428 (let ((pure-address |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2429 (nth 1 (gnus-extract-address-components address)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2430 (push (or pure-address address) contents))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2431 (nreverse contents)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2432 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2433 (defun spam-from-listed-p (type) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2434 (let ((from (message-fetch-field "from")) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2435 found) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2436 (spam-filelist-check-cache type from))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2437 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2438 (defun spam-filelist-register-routine (articles blacklist &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2439 (let ((de-symbol (if blacklist 'spam-use-whitelist 'spam-use-blacklist)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2440 (declassification (if blacklist 'ham 'spam)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2441 (enter-function |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2442 (if blacklist 'spam-enter-blacklist 'spam-enter-whitelist)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2443 (remove-function |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2444 (if blacklist 'spam-enter-whitelist 'spam-enter-blacklist)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2445 from addresses unregister-list article-unregister-list) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2446 (dolist (article articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2447 (let ((from (spam-fetch-field-from-fast article)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2448 (id (spam-fetch-field-message-id-fast article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2449 sender-ignored) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2450 (when (stringp from) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2451 (dolist (ignore-regex spam-blacklist-ignored-regexes) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2452 (when (and (not sender-ignored) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2453 (stringp ignore-regex) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2454 (string-match ignore-regex from)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2455 (setq sender-ignored t))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2456 ;; remember the messages we need to unregister, unless remove is set |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2457 (when (and |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2458 (null unregister) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2459 (spam-log-unregistration-needed-p |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2460 id 'process declassification de-symbol)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2461 (push article article-unregister-list) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2462 (push from unregister-list)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2463 (unless sender-ignored |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2464 (push from addresses))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2465 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2466 (if unregister |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2467 (funcall enter-function addresses t) ; unregister all these addresses |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2468 ;; else, register normally and unregister what we need to |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2469 (funcall remove-function unregister-list t) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2470 (dolist (article article-unregister-list) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2471 (spam-log-undo-registration |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2472 (spam-fetch-field-message-id-fast article) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2473 'process |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2474 declassification |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2475 de-symbol)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2476 (funcall enter-function addresses nil)))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2477 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2478 (defun spam-blacklist-unregister-routine (articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2479 (spam-blacklist-register-routine articles t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2480 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2481 (defun spam-blacklist-register-routine (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2482 (spam-filelist-register-routine articles t unregister)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2483 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2484 (defun spam-whitelist-unregister-routine (articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2485 (spam-whitelist-register-routine articles t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2486 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2487 (defun spam-whitelist-register-routine (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2488 (spam-filelist-register-routine articles nil unregister)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2489 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2490 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2491 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2492 ;;{{{ Spam-report glue (gmane and resend reporting) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2493 (defun spam-report-gmane-register-routine (articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2494 (when articles |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2495 (apply 'spam-report-gmane-spam articles))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2496 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2497 (defun spam-report-gmane-unregister-routine (articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2498 (when articles |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2499 (apply 'spam-report-gmane-ham articles))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2500 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2501 (defun spam-report-resend-register-ham-routine (articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2502 (spam-report-resend-register-routine articles t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2503 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2504 (defun spam-report-resend-register-routine (articles &optional ham) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2505 (let* ((resend-to-gp |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2506 (if ham |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2507 (gnus-parameter-ham-resend-to gnus-newsgroup-name) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2508 (gnus-parameter-spam-resend-to gnus-newsgroup-name))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2509 (spam-report-resend-to (or (car-safe resend-to-gp) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2510 spam-report-resend-to))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2511 (spam-report-resend articles ham))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2512 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2513 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2514 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2515 ;;{{{ Bogofilter |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2516 (defun spam-check-bogofilter-headers (&optional score) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2517 (let ((header (message-fetch-field spam-bogofilter-header))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2518 (when header ; return nil when no header |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2519 (if score ; scoring mode |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2520 (if (string-match "spamicity=\\([0-9.]+\\)" header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2521 (match-string 1 header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2522 "0") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2523 ;; spam detection mode |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2524 (when (string-match spam-bogofilter-bogosity-positive-spam-header |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2525 header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2526 spam-split-group))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2527 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2528 ;; return something sensible if the score can't be determined |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2529 (defun spam-bogofilter-score (&optional recheck) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2530 "Get the Bogofilter spamicity score." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2531 (interactive "P") |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2532 (save-window-excursion |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2533 (gnus-summary-show-article t) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2534 (set-buffer gnus-article-buffer) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2535 (let ((score (or (unless recheck |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2536 (spam-check-bogofilter-headers t)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2537 (spam-check-bogofilter t)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2538 (gnus-summary-show-article) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2539 (message "Spamicity score %s" score) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2540 (or score "0")))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2541 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2542 (defun spam-verify-bogofilter () |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2543 "Verify the Bogofilter version is sufficient." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2544 (when (eq spam-bogofilter-valid 'unknown) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2545 (setq spam-bogofilter-valid |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2546 (not (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\." |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2547 (shell-command-to-string |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2548 (format "%s -V" spam-bogofilter-program)))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2549 spam-bogofilter-valid) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2550 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2551 (defun spam-check-bogofilter (&optional score) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2552 "Check the Bogofilter backend for the classification of this message." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2553 (if (spam-verify-bogofilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2554 (let ((article-buffer-name (buffer-name)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2555 (db spam-bogofilter-database-directory) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2556 return) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2557 (with-temp-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2558 (let ((temp-buffer-name (buffer-name))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2559 (with-current-buffer article-buffer-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2560 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2561 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2562 spam-bogofilter-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2563 nil temp-buffer-name nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2564 (if db `("-d" ,db "-v") `("-v")))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2565 (setq return (spam-check-bogofilter-headers score)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2566 return) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2567 (gnus-error 5 "`spam.el' doesn't support obsolete bogofilter versions"))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2568 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2569 (defun spam-bogofilter-register-with-bogofilter (articles |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2570 spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2571 &optional unregister) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2572 "Register an article, given as a string, as spam or non-spam." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2573 (if (spam-verify-bogofilter) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2574 (dolist (article articles) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2575 (let ((article-string (spam-get-article-as-string article)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2576 (db spam-bogofilter-database-directory) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2577 (switch (if unregister |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2578 (if spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2579 spam-bogofilter-spam-strong-switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2580 spam-bogofilter-ham-strong-switch) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2581 (if spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2582 spam-bogofilter-spam-switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2583 spam-bogofilter-ham-switch)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2584 (when (stringp article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2585 (with-temp-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2586 (insert article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2587 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2588 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2589 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2590 spam-bogofilter-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2591 nil nil nil switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2592 (if db `("-d" ,db "-v") `("-v"))))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2593 (gnus-error 5 "`spam.el' doesn't support obsolete bogofilter versions"))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2594 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2595 (defun spam-bogofilter-register-spam-routine (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2596 (spam-bogofilter-register-with-bogofilter articles t unregister)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2597 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2598 (defun spam-bogofilter-unregister-spam-routine (articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2599 (spam-bogofilter-register-spam-routine articles t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2600 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2601 (defun spam-bogofilter-register-ham-routine (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2602 (spam-bogofilter-register-with-bogofilter articles nil unregister)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2603 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2604 (defun spam-bogofilter-unregister-ham-routine (articles) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2605 (spam-bogofilter-register-ham-routine articles t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2606 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2607 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2608 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2609 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2610 ;;{{{ spamoracle |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2611 (defun spam-check-spamoracle () |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2612 "Run spamoracle on an article to determine whether it's spam." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2613 (let ((article-buffer-name (buffer-name))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2614 (with-temp-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2615 (let ((temp-buffer-name (buffer-name))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2616 (with-current-buffer article-buffer-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2617 (let ((status |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2618 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2619 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2620 spam-spamoracle-binary |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2621 nil temp-buffer-name nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2622 (if spam-spamoracle-database |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2623 `("-f" ,spam-spamoracle-database "mark") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2624 '("mark"))))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2625 (if (eq 0 status) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2626 (progn |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2627 (set-buffer temp-buffer-name) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2628 (goto-char (point-min)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2629 (when (re-search-forward "^X-Spam: yes;" nil t) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2630 spam-split-group)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2631 (error "Error running spamoracle: %s" status)))))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2632 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2633 (defun spam-spamoracle-learn (articles article-is-spam-p &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2634 "Run spamoracle in training mode." |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2635 (with-temp-buffer |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2636 (let ((temp-buffer-name (buffer-name))) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2637 (save-excursion |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2638 (goto-char (point-min)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2639 (dolist (article articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2640 (insert (spam-get-article-as-string article))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2641 (let* ((arg (if (spam-xor unregister article-is-spam-p) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2642 "-spam" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2643 "-good")) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2644 (status |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2645 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2646 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2647 spam-spamoracle-binary |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2648 nil temp-buffer-name nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2649 (if spam-spamoracle-database |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2650 `("-f" ,spam-spamoracle-database |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2651 "add" ,arg) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2652 `("add" ,arg))))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2653 (unless (eq 0 status) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2654 (error "Error running spamoracle: %s" status))))))) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2655 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2656 (defun spam-spamoracle-learn-ham (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2657 (spam-spamoracle-learn articles nil unregister)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2658 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2659 (defun spam-spamoracle-unlearn-ham (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2660 (spam-spamoracle-learn-ham articles t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2661 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2662 (defun spam-spamoracle-learn-spam (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2663 (spam-spamoracle-learn articles t unregister)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2664 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2665 (defun spam-spamoracle-unlearn-spam (articles &optional unregister) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2666 (spam-spamoracle-learn-spam articles t)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2667 |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2668 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2669 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2670 ;;{{{ SpamAssassin |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2671 ;;; based mostly on the bogofilter code |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2672 (defun spam-check-spamassassin-headers (&optional score) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2673 "Check the SpamAssassin headers for the classification of this message." |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2674 (if score ; scoring mode |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2675 (let ((header (message-fetch-field spam-spamassassin-spam-status-header))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2676 (when header |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2677 (if (string-match spam-spamassassin-score-regexp header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2678 (match-string 1 header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2679 "0"))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2680 ;; spam detection mode |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2681 (let ((header (message-fetch-field spam-spamassassin-spam-flag-header))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2682 (when header ; return nil when no header |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2683 (when (string-match spam-spamassassin-positive-spam-flag-header |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2684 header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2685 spam-split-group))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2686 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2687 (defun spam-check-spamassassin (&optional score) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2688 "Check the SpamAssassin backend for the classification of this message." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2689 (let ((article-buffer-name (buffer-name))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2690 (with-temp-buffer |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2691 (let ((temp-buffer-name (buffer-name))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2692 (with-current-buffer article-buffer-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2693 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2694 (point-min) (point-max) spam-assassin-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2695 nil temp-buffer-name nil spam-spamassassin-arguments)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2696 ;; check the return now (we're back in the temp buffer) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2697 (goto-char (point-min)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2698 (spam-check-spamassassin-headers score))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2699 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2700 ;; return something sensible if the score can't be determined |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2701 (defun spam-spamassassin-score (&optional recheck) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2702 "Get the SpamAssassin score" |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2703 (interactive "P") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2704 (save-window-excursion |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2705 (gnus-summary-show-article t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2706 (set-buffer gnus-article-buffer) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2707 (let ((score (or (unless recheck |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2708 (spam-check-spamassassin-headers t)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2709 (spam-check-spamassassin t)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2710 (gnus-summary-show-article) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2711 (message "SpamAssassin score %s" score) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2712 (or score "0")))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2713 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2714 (defun spam-spamassassin-register-with-sa-learn (articles spam |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2715 &optional unregister) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2716 "Register articles with spamassassin's sa-learn as spam or non-spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2717 (if articles |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2718 (let ((action (if unregister spam-sa-learn-unregister-switch |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2719 (if spam spam-sa-learn-spam-switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2720 spam-sa-learn-ham-switch))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2721 (summary-buffer-name (buffer-name))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2722 (with-temp-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2723 ;; group the articles into mbox format |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2724 (dolist (article articles) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2725 (let (article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2726 (with-current-buffer summary-buffer-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2727 (setq article-string (spam-get-article-as-string article))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2728 (when (stringp article-string) |
112372
539ff9c0e704
gnus-art.el (gnus-article-add-buttons): Simplify condition.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
112228
diff
changeset
|
2729 ;; mbox separator |
539ff9c0e704
gnus-art.el (gnus-article-add-buttons): Simplify condition.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
112228
diff
changeset
|
2730 (insert (concat "From nobody " (current-time-string) "\n")) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2731 (insert article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2732 (insert "\n")))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2733 ;; call sa-learn on all messages at the same time |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2734 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2735 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2736 spam-sa-learn-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2737 nil nil nil "--mbox" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2738 (if spam-sa-learn-rebuild |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2739 (list action) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2740 `("--no-rebuild" ,action))))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2741 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2742 (defun spam-spamassassin-register-spam-routine (articles &optional unregister) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2743 (spam-spamassassin-register-with-sa-learn articles t unregister)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2744 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2745 (defun spam-spamassassin-register-ham-routine (articles &optional unregister) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2746 (spam-spamassassin-register-with-sa-learn articles nil unregister)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2747 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2748 (defun spam-spamassassin-unregister-spam-routine (articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2749 (spam-spamassassin-register-with-sa-learn articles t t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2750 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2751 (defun spam-spamassassin-unregister-ham-routine (articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2752 (spam-spamassassin-register-with-sa-learn articles nil t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2753 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2754 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2755 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2756 ;;{{{ Bsfilter |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2757 ;;; based mostly on the bogofilter code |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2758 (defun spam-check-bsfilter-headers (&optional score) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2759 (if score |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2760 (or (nnmail-fetch-field spam-bsfilter-probability-header) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2761 "0") |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2762 (let ((header (nnmail-fetch-field spam-bsfilter-header))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2763 (when header ; return nil when no header |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2764 (when (string-match "YES" header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2765 spam-split-group))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2766 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2767 ;; return something sensible if the score can't be determined |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2768 (defun spam-bsfilter-score (&optional recheck) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2769 "Get the Bsfilter spamicity score." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2770 (interactive "P") |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2771 (save-window-excursion |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2772 (gnus-summary-show-article t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2773 (set-buffer gnus-article-buffer) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2774 (let ((score (or (unless recheck |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2775 (spam-check-bsfilter-headers t)) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2776 (spam-check-bsfilter t)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2777 (gnus-summary-show-article) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2778 (message "Spamicity score %s" score) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2779 (or score "0")))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2780 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2781 (defun spam-check-bsfilter (&optional score) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2782 "Check the Bsfilter backend for the classification of this message." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2783 (let ((article-buffer-name (buffer-name)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2784 (dir spam-bsfilter-database-directory) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2785 return) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2786 (with-temp-buffer |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2787 (let ((temp-buffer-name (buffer-name))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2788 (with-current-buffer article-buffer-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2789 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2790 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2791 spam-bsfilter-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2792 nil temp-buffer-name nil |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2793 "--pipe" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2794 "--insert-flag" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2795 "--insert-probability" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2796 (when dir |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2797 (list "--homedir" dir)))) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2798 (setq return (spam-check-bsfilter-headers score)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2799 return)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2800 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2801 (defun spam-bsfilter-register-with-bsfilter (articles |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2802 spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2803 &optional unregister) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2804 "Register an article, given as a string, as spam or non-spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2805 (dolist (article articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2806 (let ((article-string (spam-get-article-as-string article)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2807 (switch (if unregister |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2808 (if spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2809 spam-bsfilter-spam-strong-switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2810 spam-bsfilter-ham-strong-switch) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2811 (if spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2812 spam-bsfilter-spam-switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2813 spam-bsfilter-ham-switch)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2814 (when (stringp article-string) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2815 (with-temp-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2816 (insert article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2817 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2818 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2819 spam-bsfilter-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2820 nil nil nil switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2821 "--update" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2822 (when spam-bsfilter-database-directory |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2823 (list "--homedir" |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2824 spam-bsfilter-database-directory)))))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2825 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2826 (defun spam-bsfilter-register-spam-routine (articles &optional unregister) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2827 (spam-bsfilter-register-with-bsfilter articles t unregister)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2828 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2829 (defun spam-bsfilter-unregister-spam-routine (articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2830 (spam-bsfilter-register-spam-routine articles t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2831 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2832 (defun spam-bsfilter-register-ham-routine (articles &optional unregister) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2833 (spam-bsfilter-register-with-bsfilter articles nil unregister)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2834 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2835 (defun spam-bsfilter-unregister-ham-routine (articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2836 (spam-bsfilter-register-ham-routine articles t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2837 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2838 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2839 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2840 ;;{{{ CRM114 Mailfilter |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2841 (defun spam-check-crm114-headers (&optional score) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2842 (let ((header (message-fetch-field spam-crm114-header))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2843 (when header ; return nil when no header |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2844 (if score ; scoring mode |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2845 (if (string-match "( pR: \\([0-9.-]+\\)" header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2846 (match-string 1 header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2847 "0") |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2848 ;; spam detection mode |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2849 (when (string-match spam-crm114-positive-spam-header |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2850 header) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2851 spam-split-group))))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2852 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2853 ;; return something sensible if the score can't be determined |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2854 (defun spam-crm114-score () |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2855 "Get the CRM114 Mailfilter pR." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2856 (interactive) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2857 (save-window-excursion |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2858 (gnus-summary-show-article t) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2859 (set-buffer gnus-article-buffer) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2860 (let ((score (or (spam-check-crm114-headers t) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2861 (spam-check-crm114 t)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2862 (gnus-summary-show-article) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2863 (message "pR: %s" score) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2864 (or score "0")))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2865 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2866 (defun spam-check-crm114 (&optional score) |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2867 "Check the CRM114 Mailfilter backend for the classification of this message." |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2868 (let ((article-buffer-name (buffer-name)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2869 (db spam-crm114-database-directory) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2870 return) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2871 (with-temp-buffer |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2872 (let ((temp-buffer-name (buffer-name))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2873 (with-current-buffer article-buffer-name |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2874 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2875 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2876 spam-crm114-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2877 nil temp-buffer-name nil |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2878 (when db (list (concat "--fileprefix=" db))))) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2879 (setq return (spam-check-crm114-headers score)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2880 return)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2881 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2882 (defun spam-crm114-register-with-crm114 (articles |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2883 spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2884 &optional unregister) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2885 "Register an article, given as a string, as spam or non-spam." |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2886 (dolist (article articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2887 (let ((article-string (spam-get-article-as-string article)) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2888 (db spam-crm114-database-directory) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2889 (switch (if unregister |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2890 (if spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2891 spam-crm114-spam-strong-switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2892 spam-crm114-ham-strong-switch) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2893 (if spam |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2894 spam-crm114-spam-switch |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2895 spam-crm114-ham-switch)))) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2896 (when (stringp article-string) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2897 (with-temp-buffer |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2898 (insert article-string) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2899 |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2900 (apply 'call-process-region |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2901 (point-min) (point-max) |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2902 spam-crm114-program |
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2903 nil nil nil |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2904 (when db (list switch (concat "--fileprefix=" db))))))))) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2905 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2906 (defun spam-crm114-register-spam-routine (articles &optional unregister) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2907 (spam-crm114-register-with-crm114 articles t unregister)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2908 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2909 (defun spam-crm114-unregister-spam-routine (articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2910 (spam-crm114-register-spam-routine articles t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2911 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2912 (defun spam-crm114-register-ham-routine (articles &optional unregister) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2913 (spam-crm114-register-with-crm114 articles nil unregister)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2914 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2915 (defun spam-crm114-unregister-ham-routine (articles) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2916 (spam-crm114-register-ham-routine articles t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2917 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2918 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2919 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2920 ;;}}} |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2921 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2922 ;;{{{ Hooks |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2923 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2924 ;;;###autoload |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2925 (defun spam-initialize (&rest symbols) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2926 "Install the spam.el hooks and do other initialization. |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2927 When SYMBOLS is given, set those variables to t. This is so you |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2928 can call `spam-initialize' before you set spam-use-* variables on |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2929 explicitly, and matters only if you need the extra headers |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2930 installed through `spam-necessary-extra-headers'." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2931 (interactive) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2932 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2933 (dolist (var symbols) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2934 (set var t)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2935 |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2936 (dolist (header (spam-necessary-extra-headers)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2937 (add-to-list 'nnmail-extra-headers header) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2938 (add-to-list 'gnus-extra-headers header)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2939 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2940 (setq spam-install-hooks t) |
63480
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62755
diff
changeset
|
2941 ;; TODO: How do we redo this every time the `spam' face is customized? |
53e7abe8917f
Revision: miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-425
Miles Bader <miles@gnu.org>
parents:
62755
diff
changeset
|
2942 (push '((eq mark gnus-spam-mark) . spam) |
111968
1156a55fd2a9
spam.el: Reindent and fix long lines.
Katsumi Yamaoka <yamaoka@jpl.org>
parents:
111067
diff
changeset
|
2943 gnus-summary-highlight) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2944 ;; Add hooks for loading and saving the spam stats |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2945 (add-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2946 (add-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2947 (add-hook 'gnus-startup-hook 'spam-maybe-spam-stat-load) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2948 (add-hook 'gnus-summary-prepare-exit-hook 'spam-summary-prepare-exit) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2949 (add-hook 'gnus-summary-prepare-hook 'spam-summary-prepare) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2950 (add-hook 'gnus-get-new-news-hook 'spam-setup-widening) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2951 (add-hook 'gnus-summary-prepared-hook 'spam-find-spam)) |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2952 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2953 (defun spam-unload-hook () |
86328
6276fcac4dc8
(spam-find-spam, spam-enter-list): Doc fixes.
Juanma Barranquero <lekktu@gmail.com>
parents:
85712
diff
changeset
|
2954 "Uninstall the spam.el hooks." |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2955 (interactive) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2956 (remove-hook 'gnus-save-newsrc-hook 'spam-maybe-spam-stat-save) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2957 (remove-hook 'gnus-get-top-new-news-hook 'spam-maybe-spam-stat-load) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2958 (remove-hook 'gnus-startup-hook 'spam-maybe-spam-stat-load) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2959 (remove-hook 'gnus-summary-prepare-exit-hook 'spam-summary-prepare-exit) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2960 (remove-hook 'gnus-summary-prepare-hook 'spam-summary-prepare) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2961 (remove-hook 'gnus-get-new-news-hook 'spam-setup-widening) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2962 (remove-hook 'gnus-summary-prepare-hook 'spam-find-spam)) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2963 |
57549
8479451930d1
Delete duplicate `provide'.
Richard M. Stallman <rms@gnu.org>
parents:
57265
diff
changeset
|
2964 (add-hook 'spam-unload-hook 'spam-unload-hook) |
8479451930d1
Delete duplicate `provide'.
Richard M. Stallman <rms@gnu.org>
parents:
57265
diff
changeset
|
2965 |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2966 (when spam-install-hooks |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2967 (spam-initialize)) |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
2968 ;;}}} |
56927
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2969 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2970 (provide 'spam) |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2971 |
55fd4f77387a
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff
changeset
|
2972 ;;; spam.el ends here |