Synch to No Gnus 200509211443.
authoryamaoka <yamaoka>
Wed, 21 Sep 2005 22:03:43 +0000 (22:03 +0000)
committeryamaoka <yamaoka>
Wed, 21 Sep 2005 22:03:43 +0000 (22:03 +0000)
lisp/ChangeLog
lisp/spam-report.el
lisp/spam.el
texi/ChangeLog
texi/gnus-ja.texi
texi/gnus.texi

index 888e2fd..55a4fbe 100644 (file)
@@ -1,3 +1,14 @@
+2005-09-21  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * spam.el (spam-use-gmane, spam-report-gmane-register-routine)
+       (spam-report-gmane-unregister-routine): added support for gmane
+       unregistration
+
+       * spam-report.el (spam-report-gmane-unspam)
+       (spam-report-gmane-spam): new wrappers around spam-report-gmane
+       (spam-report-gmane): changed to take a single article and do
+       unspam registration
+
 2005-09-21  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * mm-view.el (mm-inline-text-html-render-with-w3m): Revert.
index febf182..e5f342e 100644 (file)
@@ -115,52 +115,61 @@ Reports is as ham when HAM is set."
   "Report an article as ham by resending via email."
   (spam-report-resend articles t))
 
-(defun spam-report-gmane (&rest articles)
-  "Report an article as spam through Gmane."
+(defun spam-report-gmane-unspam (&rest articles)
+  "Report ARTICLES as not-spam (unregister) through Gmane."
   (interactive (gnus-summary-work-articles current-prefix-arg))
   (dolist (article articles)
-    (when (and gnus-newsgroup-name
-              (or (null spam-report-gmane-regex)
-                  (string-match spam-report-gmane-regex gnus-newsgroup-name)))
-      (gnus-message 6 "Reporting spam article %d to spam.gmane.org..." article)
-      (if spam-report-gmane-use-article-number
-         (spam-report-url-ping
-          "spam.gmane.org"
-          (format "/%s:%d"
-                  (gnus-group-real-name gnus-newsgroup-name)
-                  article))
-       (with-current-buffer nntp-server-buffer
-         (gnus-request-head article gnus-newsgroup-name)
-         (let ((case-fold-search t)
-               field host report url)
-           ;; First check for X-Report-Spam because it's more specific to
-           ;; spam reporting than Archived-At.  OTOH, all new articles on
-           ;; Gmane don't have X-Report-Spam anymore (unless Lars changes his
-           ;; mind :-)).
-           ;;
-           ;; There might be more than one Archived-At header so we need to
-           ;; find (and transform) the one related to Gmane.
-           (setq field (or (gnus-fetch-field "X-Report-Spam")
-                           (gnus-fetch-field "Archived-At")))
-           (setq host (progn
-                        (string-match
-                         (concat "http://\\([a-z]+\\.gmane\\.org\\)"
-                                 "\\(/[^:/]+[:/][0-9]+\\)")
-                         field)
-                        (match-string 1 field)))
-           (setq report (match-string 2 field))
-           (when (string-equal "permalink.gmane.org" host)
-             (setq host "spam.gmane.org")
-             (setq report (gnus-replace-in-string
-                           report "/\\([0-9]+\\)$" ":\\1")))
-           (setq url (format "http://%s%s" host report))
-           (if (not (and host report url))
-               (gnus-message
-                3 "Could not find a spam report header in article %d..."
-                article)
-             (gnus-message 7 "Reporting spam through URL %s..." url)
-             (spam-report-url-ping host report))))))))
+    (spam-report-gmane t article)))
 
+(defun spam-report-gmane-spam (&rest articles)
+  "Report ARTICLES as spam through Gmane."
+  (interactive (gnus-summary-work-articles current-prefix-arg))
+  (dolist (article articles)
+    (spam-report-gmane nil article)))
+
+(defun spam-report-gmane (unspam article)
+  "Report ARTICLE as spam or not-spam through Gmane, depending on UNSPAM."
+  (when (and gnus-newsgroup-name
+            (or (null spam-report-gmane-regex)
+                (string-match spam-report-gmane-regex gnus-newsgroup-name)))
+    (gnus-message 6 "Reporting spam article %d to spam.gmane.org..." article)
+    (if spam-report-gmane-use-article-number
+       (spam-report-url-ping
+        (if unspam "unspam.gmane.org" "spam.gmane.org")
+        (format "/%s:%d"
+                (gnus-group-real-name gnus-newsgroup-name)
+                article))
+      (with-current-buffer nntp-server-buffer
+       (gnus-request-head article gnus-newsgroup-name)
+       (let ((case-fold-search t)
+             field host report url)
+         ;; First check for X-Report-Spam because it's more specific to
+         ;; spam reporting than Archived-At.  OTOH, all new articles on
+         ;; Gmane don't have X-Report-Spam anymore (unless Lars changes his
+         ;; mind :-)).
+         ;;
+         ;; There might be more than one Archived-At header so we need to
+         ;; find (and transform) the one related to Gmane.
+         (setq field (or (gnus-fetch-field "X-Report-Spam")
+                         (gnus-fetch-field "Archived-At")))
+         (setq host (progn
+                      (string-match
+                       (concat "http://\\([a-z]+\\.gmane\\.org\\)"
+                               "\\(/[^:/]+[:/][0-9]+\\)")
+                       field)
+                      (match-string 1 field)))
+         (setq report (match-string 2 field))
+         (when (string-equal "permalink.gmane.org" host)
+           (setq host (if unspam "unspam.gmane.org" "spam.gmane.org"))
+           (setq report (gnus-replace-in-string
+                         report "/\\([0-9]+\\)$" ":\\1")))
+         (setq url (format "http://%s%s" host report))
+         (if (not (and host report url))
+             (gnus-message
+              3 "Could not find a spam report header in article %d..."
+              article)
+           (gnus-message 7 "Reporting %s through URL %s..." (if unspam "unspam" "spam") url)
+           (spam-report-url-ping host report)))))))
 
 (defun spam-report-url-ping (host report)
   "Ping a host through HTTP, addressing a specific GET resource using
index 83eba51..27ca9d7 100644 (file)
@@ -1056,11 +1056,10 @@ backends)."
                              nil)
 
 (spam-install-nocheck-backend 'spam-use-gmane
-                             nil
+                             'spam-report-gmane-unregister-routine
                              'spam-report-gmane-register-routine
-                             ;; does Gmane support unregistration?
-                             nil
-                             nil)
+                             'spam-report-gmane-register-routine
+                             'spam-report-gmane-unregister-routine)
 
 (spam-install-nocheck-backend 'spam-use-resend
                              'spam-report-resend-register-ham-routine
@@ -2436,7 +2435,11 @@ REMOVE not nil, remove the ADDRESSES."
 ;;{{{ Spam-report glue (gmane and resend reporting)
 (defun spam-report-gmane-register-routine (articles)
   (when articles
-    (apply 'spam-report-gmane articles)))
+    (apply 'spam-report-gmane-spam articles)))
+
+(defun spam-report-gmane-unregister-routine (articles)
+  (when articles
+    (apply 'spam-report-gmane-unspam articles)))
 
 (defun spam-report-resend-register-ham-routine (articles)
   (spam-report-resend-register-routine articles t))
index 1ac49c2..1f670ab 100644 (file)
@@ -1,3 +1,11 @@
+2005-09-21  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * gnus.texi (Blacklists and Whitelists)
+       (Blacklists and Whitelists, BBDB Whitelists)
+       (Gmane Spam Reporting, Bogofilter, spam-stat spam filtering)
+       (spam-stat spam filtering, SpamOracle)
+       (Extending the Spam ELisp package): removed extra quote symbol for clarity
+
 2005-09-20  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * gnus.texi (MIME Commands): Add gnus-article-save-part-and-strip,
index 22b8555..9a7c944 100644 (file)
@@ -23188,7 +23188,7 @@ From Reiner Steib <reiner.steib@@gmx.de>.
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-spam-exit-processor-blacklist} \e$B$NBe$o$j$K!"\e(B
-@code{'(spam spam-use-blacklist)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
+@code{(spam spam-use-blacklist)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
 \e$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
 
 @end defvar
@@ -23204,8 +23204,8 @@ From Reiner Steib <reiner.steib@@gmx.de>.
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-ham-exit-processor-whitelist} \e$B$NBe$o$j$K!"\e(B
-@code{'(ham spam-use-whitelist)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
-\e$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
+@code{(ham spam-use-whitelist)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n\e(B
+\e$B$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
 
 @end defvar
 
@@ -23270,7 +23270,7 @@ From Reiner Steib <reiner.steib@@gmx.de>.
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-ham-exit-processor-BBDB} \e$B$NBe$o$j$K!"\e(B
-@code{'(ham spam-use-BBDB)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k\e(B
+@code{(ham spam-use-BBDB)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k\e(B
 \e$B$3$H$OJ]>Z$5$l$^$9!#\e(B
 
 @end defvar
@@ -23294,7 +23294,7 @@ Gmane \e$B$O\e(B @uref{http://gmane.org} \e$B$G8+$D$1$k$3$H$,$G$-$^$9!#\e(B
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-spam-exit-processor-report-gmane} \e$B$NBe$o$j$K!"\e(B
-@code{'(spam spam-use-gmane)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9\e(B
+@code{(spam spam-use-gmane)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9\e(B
 \e$B$k$3$H$OJ]>Z$5$l$^$9!#\e(B
 
 @end defvar
@@ -23461,8 +23461,8 @@ Path \e$B$K\e(B @code{bogofilter} \e$B$N<B9T%U%!%$%k$,L5$$>l9g!"\e(BBogofilter \e$B$N
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-spam-exit-processor-bogofilter} \e$B$NBe$o$j$K!"\e(B
-@code{'(spam spam-use-bogofilter)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$K\e(B
-\e$BF0:n$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
+@code{(spam spam-use-bogofilter)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
+\e$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
 @end defvar
 
 @defvar gnus-group-ham-exit-processor-bogofilter
@@ -23476,7 +23476,7 @@ Path \e$B$K\e(B @code{bogofilter} \e$B$N<B9T%U%!%$%k$,L5$$>l9g!"\e(BBogofilter \e$B$N
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-ham-exit-processor-bogofilter} \e$B$NBe$o$j$K!"\e(B
-@code{'(ham spam-use-bogofilter)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
+@code{(ham spam-use-bogofilter)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
 \e$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
 @end defvar
 
@@ -23616,8 +23616,8 @@ Emacs Lisp \e$B$K$h$kE}7WJ,@O4o$G$"$k\e(B spam-stat.el \e$B$r\e(B @code{spam-split}
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-spam-exit-processor-stat} \e$B$NBe$o$j$K!"\e(B
-@code{'(spam spam-use-stat)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9\e(B
-\e$B$k$3$H$OJ]>Z$5$l$^$9!#\e(B
+@code{(spam spam-use-stat)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k\e(B
+\e$B$3$H$OJ]>Z$5$l$^$9!#\e(B
 @end defvar
 
 @defvar gnus-group-ham-exit-processor-stat
@@ -23631,7 +23631,7 @@ Emacs Lisp \e$B$K$h$kE}7WJ,@O4o$G$"$k\e(B spam-stat.el \e$B$r\e(B @code{spam-split}
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-ham-exit-processor-stat} \e$B$NBe$o$j$K!"\e(B
-@code{'(ham spam-use-stat)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k\e(B
+@code{(ham spam-use-stat)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k\e(B
 \e$B$3$H$OJ]>Z$5$l$^$9!#\e(B
 @end defvar
 
@@ -23721,8 +23721,8 @@ ELisp Package}.
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-spam-exit-processor-spamoracle} \e$B$NBe$o$j$K!"\e(B
-@code{'(spam spam-use-spamoracle)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$K\e(B
-\e$BF0:n$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
+@code{(spam spam-use-spamoracle)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
+\e$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
 @end defvar
 
 @defvar gnus-group-ham-exit-processor-spamoracle
@@ -23736,7 +23736,7 @@ ELisp Package}.
 @emph{\e$B7Y9p\e(B}
 
 \e$BGQ$l$?\e(B @code{gnus-group-ham-exit-processor-spamoracle} \e$B$NBe$o$j$K!"\e(B
-@code{'(ham spam-use-spamoracle)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
+@code{(ham spam-use-spamoracle)} \e$B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0\e(B
 \e$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#\e(B
 @end defvar
 
@@ -23807,8 +23807,8 @@ Blackbox \e$B$,\e(B spam \e$B$^$?$O\e(B ham \e$B$N=hM}$r%5%]!<%H$9$k>l9g$@$1!"$=$l$i$
 \e$B$F2<$5$$!#\e(B
 
 \e$B$5$i$K\e(B ham \e$B$H\e(B spam \e$B$N%W%m%;%C%5!<$OC10l$NJQ?t$G$O$J$/$5$l$D$D$"$j!"Be$o\e(B
-\e$B$j$K\e(B @code{'(spam spam-use-blackbox)} \e$B$^$?\e(B
-\e$B$O\e(B @code{'(ham spam-use-blackbox)} \e$B$N7A<0$,?d>)$5$l$^$9!#:#$N$H$3\e(B
+\e$B$j$K\e(B @code{(spam spam-use-blackbox)} \e$B$^$?\e(B
+\e$B$O\e(B @code{(ham spam-use-blackbox)} \e$B$N7A<0$,?d>)$5$l$^$9!#:#$N$H$3\e(B
 \e$B$m\e(B spam/ham \e$B%W%m%;%C%5!<JQ?t$O$^$@$"$A$3$A$K$"$j$^$9$,!"D9$/$O$"$j$^$;$s!#\e(B
 
 @lisp
index 5a6311b..2b2b0ae 100644 (file)
@@ -23848,7 +23848,7 @@ spam-marked articles will be added to the blacklist.
 
 Instead of the obsolete
 @code{gnus-group-spam-exit-processor-blacklist}, it is recommended
-that you use @code{'(spam spam-use-blacklist)}.  Everything will work
+that you use @code{(spam spam-use-blacklist)}.  Everything will work
 the same way, we promise.
 
 @end defvar
@@ -23866,7 +23866,7 @@ whitelist.
 
 Instead of the obsolete
 @code{gnus-group-ham-exit-processor-whitelist}, it is recommended
-that you use @code{'(ham spam-use-whitelist)}.  Everything will work
+that you use @code{(ham spam-use-whitelist)}.  Everything will work
 the same way, we promise.
 
 @end defvar
@@ -23937,7 +23937,7 @@ BBDB.
 
 Instead of the obsolete
 @code{gnus-group-ham-exit-processor-BBDB}, it is recommended
-that you use @code{'(ham spam-use-BBDB)}.  Everything will work
+that you use @code{(ham spam-use-BBDB)}.  Everything will work
 the same way, we promise.
 
 @end defvar
@@ -23964,7 +23964,7 @@ Gmane can be found at @uref{http://gmane.org}.
 
 Instead of the obsolete
 @code{gnus-group-spam-exit-processor-report-gmane}, it is recommended
-that you use @code{'(spam spam-use-gmane)}.  Everything will work the
+that you use @code{(spam spam-use-gmane)}.  Everything will work the
 same way, we promise.
 
 @end defvar
@@ -24131,7 +24131,7 @@ will be added to the Bogofilter spam database.
 
 Instead of the obsolete
 @code{gnus-group-spam-exit-processor-bogofilter}, it is recommended
-that you use @code{'(spam spam-use-bogofilter)}.  Everything will work
+that you use @code{(spam spam-use-bogofilter)}.  Everything will work
 the same way, we promise.
 @end defvar
 
@@ -24147,7 +24147,7 @@ of non-spam messages.
 
 Instead of the obsolete
 @code{gnus-group-ham-exit-processor-bogofilter}, it is recommended
-that you use @code{'(ham spam-use-bogofilter)}.  Everything will work
+that you use @code{(ham spam-use-bogofilter)}.  Everything will work
 the same way, we promise.
 @end defvar
 
@@ -24287,7 +24287,7 @@ articles will be added to the spam-stat database of spam messages.
 
 Instead of the obsolete
 @code{gnus-group-spam-exit-processor-stat}, it is recommended
-that you use @code{'(spam spam-use-stat)}.  Everything will work
+that you use @code{(spam spam-use-stat)}.  Everything will work
 the same way, we promise.
 @end defvar
 
@@ -24303,7 +24303,7 @@ of non-spam messages.
 
 Instead of the obsolete
 @code{gnus-group-ham-exit-processor-stat}, it is recommended
-that you use @code{'(ham spam-use-stat)}.  Everything will work
+that you use @code{(ham spam-use-stat)}.  Everything will work
 the same way, we promise.
 @end defvar
 
@@ -24395,7 +24395,7 @@ sent to SpamOracle as spam samples.
 
 Instead of the obsolete
 @code{gnus-group-spam-exit-processor-spamoracle}, it is recommended
-that you use @code{'(spam spam-use-spamoracle)}.  Everything will work
+that you use @code{(spam spam-use-spamoracle)}.  Everything will work
 the same way, we promise.
 @end defvar
 
@@ -24411,7 +24411,7 @@ messages.
 
 Instead of the obsolete
 @code{gnus-group-ham-exit-processor-spamoracle}, it is recommended
-that you use @code{'(ham spam-use-spamoracle)}.  Everything will work
+that you use @code{(ham spam-use-spamoracle)}.  Everything will work
 the same way, we promise.
 @end defvar
 
@@ -24479,8 +24479,8 @@ Note you don't have to provide a spam or a ham processor.  Only
 provide them if Blackbox supports spam or ham processing.
 
 Also, ham and spam processors are being phased out as single
-variables.  Instead the form @code{'(spam spam-use-blackbox)} or
-@code{'(ham spam-use-blackbox)} is favored.  For now, spam/ham
+variables.  Instead the form @code{(spam spam-use-blackbox)} or
+@code{(ham spam-use-blackbox)} is favored.  For now, spam/ham
 processor variables are still around but they won't be for long.
 
 @lisp