From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/53918 Path: main.gmane.org!not-for-mail From: Eric Knauel Newsgroups: gmane.emacs.gnus.general Subject: "url ping" spam reporting with wget Date: Tue, 09 Sep 2003 08:47:06 +0200 Sender: ding-owner@lists.math.uh.edu Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1063124646 32167 80.91.224.253 (9 Sep 2003 16:24:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Sep 2003 16:24:06 +0000 (UTC) Original-X-From: ding-owner+M2458@lists.math.uh.edu Tue Sep 09 18:24:04 2003 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19wlHg-0002wv-00 for ; Tue, 09 Sep 2003 18:24:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19wlEU-0004sT-00; Tue, 09 Sep 2003 11:20:47 -0500 Original-Received: from sclp3.sclp.com ([64.157.176.121]) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 19wcHO-00041h-00 for ding@lists.math.uh.edu; Tue, 09 Sep 2003 01:47:10 -0500 Original-Received: (qmail 20703 invoked by alias); 9 Sep 2003 06:47:09 -0000 Original-Received: (qmail 20697 invoked from network); 9 Sep 2003 06:47:08 -0000 Original-Received: from main.gmane.org (80.91.224.249) by sclp3.sclp.com with SMTP; 9 Sep 2003 06:47:08 -0000 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19wcHg-0005Ez-00 for ; Tue, 09 Sep 2003 08:47:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19wcHf-0005Er-00 for ; Tue, 09 Sep 2003 08:47:27 +0200 Original-Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 19wcHK-0001VL-00 for ; Tue, 09 Sep 2003 08:47:06 +0200 Original-Lines: 103 Original-X-Complaints-To: usenet@sea.gmane.org X-Face: $h1drS;M-yJRg.]BD:qvqStjXHS)'jNUcm'"5`NOr9.SO8pyX.Re&4N1K#/$F 32&XUgw.O7dcBD9wT01Iy7[O\CBpJaHrE}'+I.hmkh%'JhMv&AJ5Z8}nBT[?fE0\K=XW [5uyKp'VQE!0@G}kH{XxILQ`vo/8y|>IEc;tLujSPQDi@#,)Im[hb;X%*:9!QN*/Mr|G!?8T5_, User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.5 (cassava, darwin) Cancel-Lock: sha1:3t7F46GPhnhUUoPEveIDptz4eD8= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:53918 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:53918 --=-=-= Hi, here is a little patch for spam-report.el that provides a function `spam-report-url-ping-wget' that calls wget to report a spam message to gmane. I found that convenient because the orginal `spam-report-url-ping' (now `spam-report-url-ping-plain') didn't obey the http proxy settings. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: make spam-report.el use wget to report spam Index: spam-report.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/spam-report.el,v retrieving revision 6.4 diff -c -r6.4 spam-report.el *** spam-report.el 7 Aug 2003 05:02:03 -0000 6.4 --- spam-report.el 9 Sep 2003 06:51:32 -0000 *************** *** 54,59 **** --- 54,72 ---- :type 'boolean :group 'spam-report) + (defcustom spam-report-url-ping-function + 'spam-report-url-ping-plain + "Function to use for url ping spam reporting." + :type '(choice + (const :tag "Using (X)Emacs (ignore proxy settings)" spam-report-url-ping-plain) + (const :tag "Using wget" spam-report-url-ping-wget)) + :group 'spam-report) + + (defcustom spam-report-url-ping-wget-options + '("--proxy=on" "-O-" "-q") + "Options for the wget command issued by spam-report-url-ping-wget" + :group 'spam-report) + (defun spam-report-gmane (article) "Report an article as spam through Gmane" (interactive "nEnter the article number: ") *************** *** 78,85 **** (gnus-message 10 "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" (let ((tcp-connection)) (with-temp-buffer --- 91,105 ---- (gnus-message 10 "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. Use + the function specified in `spam-report-url-ping-function' for actually + doing this." + (if (functionp spam-report-url-ping-function) + (funcall spam-report-url-ping-function host report) + (spam-report-url-ping-plain host report))) + + (defun spam-report-url-ping-plain (host report) "Ping a host through HTTP, addressing a specific GET resource" (let ((tcp-connection)) (with-temp-buffer *************** *** 94,99 **** --- 114,132 ---- (process-send-string tcp-connection (format "GET %s HTTP/1.1\nHost: %s\n\n" report host))))) + + (defun spam-report-url-ping-wget (host report) + "Ping a host through HTTP, addressing a specific GET resource. Use + wget to submit the report." + (let ((wget (executable-find "wget"))) + (if wget + (let ((status (apply 'call-process wget + nil nil nil + (append spam-report-url-ping-wget-options + (list (concat host "/" report)))))) + (if (not (zerop status)) + (message "Error submitting spam report"))) + (message "Can't find executable `wget'")))) (provide 'spam-report) --=-=-= -Eric -- "Excuse me --- Di Du Du Duuuuh Di Dii --- Huh Weeeheeee" (Albert King) --=-=-=--