+2003-09-10 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * spam-report.el: use mm-url.el functions for external URL
+ loading when the built-in HTTP GET is insufficient (e.g. proxies
+ are in the way). From Eric Knauel
+ <knauel@informatik.uni-tuebingen.de>.
+ (spam-report-url-ping-function): new option, defaults to the
+ built-in HTTP GET (spam-report-url-ping-plain)
+ (spam-report-url-ping): calls spam-report-url-ping-function now
+ (spam-report-url-ping-plain): new function, does what
+ spam-report-url-ping used to do
+ (spam-report-url-ping-mm-url): function that delegates to
+ mm-url.el (autoloaded)
+
2003-09-08 Teodor Zlatanov <tzz@lifelogs.com>
* gnus-registry.el (gnus-registry-delete-id): function to
(require 'gnus)
(require 'gnus-sum)
+(eval-and-compile
+ (autoload 'mm-url-insert "mm-url"))
+
(defgroup spam-report nil
"Spam reporting configuration.")
: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 "Connect directly"
+ spam-report-url-ping-plain)
+ (const :tag "Use the external program specified in `mm-url-program'"
+ spam-report-url-ping-mm-url))
+ :group 'spam-report)
+
(defun spam-report-gmane (article)
"Report an article as spam through Gmane"
(interactive "nEnter the article number: ")
(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"
+ "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)
+ "Ping a host through HTTP, addressing a specific GET resource."
(let ((tcp-connection))
(with-temp-buffer
(or (setq tcp-connection
(format "GET %s HTTP/1.1\nHost: %s\n\n"
report host)))))
+(defun spam-report-url-ping-mm-url (host report)
+ "Ping a host through HTTP, addressing a specific GET resource. Use
+the external program specified in `mm-url-program' to connect to
+server."
+ (with-temp-buffer
+ (let ((url (concat "http://" host "/" report)))
+ (mm-url-insert url t))))
+
(provide 'spam-report)
;;; spam-report.el ends here.