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)