From: yamaoka Date: Wed, 21 Sep 2005 22:03:43 +0000 (+0000) Subject: Synch to No Gnus 200509211443. X-Git-Tag: t-gnus-6_17_4-quimby-~353 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=e384b7f896b96cf8aba480ae78218518df79a9be;p=elisp%2Fgnus.git- Synch to No Gnus 200509211443. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 888e2fd..55a4fbe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2005-09-21 Teodor Zlatanov + + * 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 * mm-view.el (mm-inline-text-html-render-with-w3m): Revert. diff --git a/lisp/spam-report.el b/lisp/spam-report.el index febf182..e5f342e 100644 --- a/lisp/spam-report.el +++ b/lisp/spam-report.el @@ -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 diff --git a/lisp/spam.el b/lisp/spam.el index 83eba51..27ca9d7 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -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)) diff --git a/texi/ChangeLog b/texi/ChangeLog index 1ac49c2..1f670ab 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,11 @@ +2005-09-21 Teodor Zlatanov + + * 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 * gnus.texi (MIME Commands): Add gnus-article-save-part-and-strip, diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 22b8555..9a7c944 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -23188,7 +23188,7 @@ From Reiner Steib . @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-spam-exit-processor-blacklist} $B$NBe$o$j$K!"(B -@code{'(spam spam-use-blacklist)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B +@code{(spam spam-use-blacklist)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B $B:n$9$k$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @@ -23204,8 +23204,8 @@ From Reiner Steib . @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-ham-exit-processor-whitelist} $B$NBe$o$j$K!"(B -@code{'(ham spam-use-whitelist)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B -$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#(B +@code{(ham spam-use-whitelist)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n(B +$B$9$k$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @@ -23270,7 +23270,7 @@ From Reiner Steib . @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-ham-exit-processor-BBDB} $B$NBe$o$j$K!"(B -@code{'(ham spam-use-BBDB)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k(B +@code{(ham spam-use-BBDB)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k(B $B$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @@ -23294,7 +23294,7 @@ Gmane $B$O(B @uref{http://gmane.org} $B$G8+$D$1$k$3$H$,$G$-$^$9!#(B @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-spam-exit-processor-report-gmane} $B$NBe$o$j$K!"(B -@code{'(spam spam-use-gmane)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9(B +@code{(spam spam-use-gmane)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9(B $B$k$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @@ -23461,8 +23461,8 @@ Path $B$K(B @code{bogofilter} $B$Nl9g!"(BBogofilter $B$N @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-spam-exit-processor-bogofilter} $B$NBe$o$j$K!"(B -@code{'(spam spam-use-bogofilter)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$K(B -$BF0:n$9$k$3$H$OJ]>Z$5$l$^$9!#(B +@code{(spam spam-use-bogofilter)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B +$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @defvar gnus-group-ham-exit-processor-bogofilter @@ -23476,7 +23476,7 @@ Path $B$K(B @code{bogofilter} $B$Nl9g!"(BBogofilter $B$N @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-ham-exit-processor-bogofilter} $B$NBe$o$j$K!"(B -@code{'(ham spam-use-bogofilter)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B +@code{(ham spam-use-bogofilter)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B $B:n$9$k$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @@ -23616,8 +23616,8 @@ Emacs Lisp $B$K$h$kE}7WJ,@O4o$G$"$k(B spam-stat.el $B$r(B @code{spam-split} @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-spam-exit-processor-stat} $B$NBe$o$j$K!"(B -@code{'(spam spam-use-stat)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9(B -$B$k$3$H$OJ]>Z$5$l$^$9!#(B +@code{(spam spam-use-stat)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k(B +$B$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @defvar gnus-group-ham-exit-processor-stat @@ -23631,7 +23631,7 @@ Emacs Lisp $B$K$h$kE}7WJ,@O4o$G$"$k(B spam-stat.el $B$r(B @code{spam-split} @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-ham-exit-processor-stat} $B$NBe$o$j$K!"(B -@code{'(ham spam-use-stat)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k(B +@code{(ham spam-use-stat)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0:n$9$k(B $B$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @@ -23721,8 +23721,8 @@ ELisp Package}. @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-spam-exit-processor-spamoracle} $B$NBe$o$j$K!"(B -@code{'(spam spam-use-spamoracle)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$K(B -$BF0:n$9$k$3$H$OJ]>Z$5$l$^$9!#(B +@code{(spam spam-use-spamoracle)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B +$B:n$9$k$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @defvar gnus-group-ham-exit-processor-spamoracle @@ -23736,7 +23736,7 @@ ELisp Package}. @emph{$B7Y9p(B} $BGQ$l$?(B @code{gnus-group-ham-exit-processor-spamoracle} $B$NBe$o$j$K!"(B -@code{'(ham spam-use-spamoracle)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B +@code{(ham spam-use-spamoracle)} $B$r;H$&$3$H$r?d>)$7$^$9!#$9$Y$FF1Ey$KF0(B $B:n$9$k$3$H$OJ]>Z$5$l$^$9!#(B @end defvar @@ -23807,8 +23807,8 @@ Blackbox $B$,(B spam $B$^$?$O(B ham $B$N=hM}$r%5%]!<%H$9$k>l9g$@$1!"$=$l$i$ $B$F2<$5$$!#(B $B$5$i$K(B ham $B$H(B spam $B$N%W%m%;%C%5!<$OC10l$NJQ?t$G$O$J$/$5$l$D$D$"$j!"Be$o(B -$B$j$K(B @code{'(spam spam-use-blackbox)} $B$^$?(B -$B$O(B @code{'(ham spam-use-blackbox)} $B$N7A<0$,?d>)$5$l$^$9!#:#$N$H$3(B +$B$j$K(B @code{(spam spam-use-blackbox)} $B$^$?(B +$B$O(B @code{(ham spam-use-blackbox)} $B$N7A<0$,?d>)$5$l$^$9!#:#$N$H$3(B $B$m(B spam/ham $B%W%m%;%C%5!