| 106 | | (goto-char (point-min)) |
|---|
| 107 | | (if (re-search-forward spam-report-gmane-spam-header nil t) |
|---|
| 108 | | (let* ((host (match-string 1)) |
|---|
| 109 | | (report (match-string 2)) |
|---|
| 110 | | (url (format "http://%s%s" host report))) |
|---|
| 111 | | (gnus-message 7 "Reporting spam through URL %s..." url) |
|---|
| 112 | | (spam-report-url-ping host report)) |
|---|
| 113 | | (gnus-message 3 "Could not find X-Report-Spam in article %d..." |
|---|
| 114 | | article))))))) |
|---|
| | 100 | (let ((case-fold-search t) |
|---|
| | 101 | field host report url) |
|---|
| | 102 | ;; First check for X-Report-Spam because it's more specific to |
|---|
| | 103 | ;; spam reporting than Archived-At. OTOH, all new articles on |
|---|
| | 104 | ;; Gmane don't have X-Report-Spam anymore (unless Lars changes his |
|---|
| | 105 | ;; mind :-)). |
|---|
| | 106 | ;; |
|---|
| | 107 | ;; There might be more than one Archived-At header so we need to |
|---|
| | 108 | ;; find (and transform) the one related to Gmane. |
|---|
| | 109 | (setq field (or (gnus-fetch-field "X-Report-Spam") |
|---|
| | 110 | (gnus-fetch-field "Archived-At"))) |
|---|
| | 111 | (setq host (progn |
|---|
| | 112 | (string-match |
|---|
| | 113 | (concat "http://\\([a-z]+\\.gmane\\.org\\)" |
|---|
| | 114 | "\\(/[^:/]+[:/][0-9]+\\)") |
|---|
| | 115 | field) |
|---|
| | 116 | (match-string 1 field))) |
|---|
| | 117 | (setq report (match-string 2 field)) |
|---|
| | 118 | (when (string-equal "permalink.gmane.org" host) |
|---|
| | 119 | (setq host "spam.gmane.org")) |
|---|
| | 120 | (setq url (format "http://%s%s" host report)) |
|---|
| | 121 | (if (not (and host report url)) |
|---|
| | 122 | (gnus-message |
|---|
| | 123 | 3 "Could not find a spam report header in article %d..." |
|---|
| | 124 | article) |
|---|
| | 125 | (gnus-message 7 "Reporting spam through URL %s..." url) |
|---|
| | 126 | (spam-report-url-ping host report)))))))) |
|---|