[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/gnus/spam-report.el
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/gnus/spam-report.el |
Date: |
Thu, 08 Sep 2005 21:47:35 -0400 |
Index: emacs/lisp/gnus/spam-report.el
diff -c emacs/lisp/gnus/spam-report.el:1.9 emacs/lisp/gnus/spam-report.el:1.10
*** emacs/lisp/gnus/spam-report.el:1.9 Sat Aug 6 19:51:42 2005
--- emacs/lisp/gnus/spam-report.el Fri Sep 9 01:47:33 2005
***************
*** 49,60 ****
(regexp :value "^nntp\+.*:gmane\."))
:group 'spam-report)
- (defcustom spam-report-gmane-spam-header
- "^X-Report-Spam: http://\\([^/]+\\)\\(.*\\)$"
- "String matching Gmane spam-reporting header. Two match groups are needed."
- :type 'regexp
- :group 'spam-report)
-
(defcustom spam-report-gmane-use-article-number t
"Whether the article number (faster!) or the header should be used."
:type 'boolean
--- 49,54 ----
***************
*** 103,121 ****
article))
(with-current-buffer nntp-server-buffer
(gnus-request-head article gnus-newsgroup-name)
! (goto-char (point-min))
! (if (re-search-forward spam-report-gmane-spam-header nil t)
! (let* ((host (match-string 1))
! (report (match-string 2))
! (url (format "http://%s%s" host report)))
! (gnus-message 7 "Reporting spam through URL %s..." url)
! (spam-report-url-ping host report))
! (gnus-message 3 "Could not find X-Report-Spam in article %d..."
! article)))))))
(defun spam-report-url-ping (host report)
"Ping a host through HTTP, addressing a specific GET resource using
the function specified by `spam-report-url-ping-function'."
(funcall spam-report-url-ping-function host report))
(defun spam-report-url-ping-plain (host report)
--- 97,136 ----
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 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))))))))
(defun spam-report-url-ping (host report)
"Ping a host through HTTP, addressing a specific GET resource using
the function specified by `spam-report-url-ping-function'."
+ ;; Example:
+ ;; host: "spam.gmane.org"
+ ;; report: "/gmane.some.group:123456"
(funcall spam-report-url-ping-function host report))
(defun spam-report-url-ping-plain (host report)
- [Emacs-diffs] Changes to emacs/lisp/gnus/spam-report.el,
Miles Bader <=