Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Knauel <knauel@informatik.uni-tuebingen.de>
Subject: Re: "url ping" spam reporting with wget
Date: Wed, 10 Sep 2003 08:52:28 +0200	[thread overview]
Message-ID: <vw33cf5jftf.fsf@informatik.uni-tuebingen.de> (raw)
In-Reply-To: <4noext3jzm.fsf@lockgroove.bwh.harvard.edu>

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]


Ted Zlatanov <tzz@lifelogs.com> writes:

> On Tue, 09 Sep 2003, knauel@informatik.uni-tuebingen.de wrote:
>> 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.
>
> I like the patch, but wouldn't it make sense, as Reiner said, to use
> a mm-url.el function as the alternative, instead of crafting our own
> replacements for it?

That makes perfect sense to me, I simply wasn't aware that mm-url.el
is already doing this for me. ;-) Here is an updated version of the
patch, autoloading mm-url if needed:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2505 bytes --]

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	10 Sep 2003 06:46:22 -0000
***************
*** 31,36 ****
--- 31,39 ----
  (require 'gnus)
  (require 'gnus-sum)
  
+ (eval-and-compile
+   (autoload 'mm-url-insert "mm-url"))
+ 
  (defgroup spam-report nil
    "Spam reporting configuration.")
  
***************
*** 54,59 ****
--- 57,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 "Connect directly" 
+ 		 spam-report-url-ping-plain)
+ 	  (const :tag "Using 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: ")
***************
*** 78,86 ****
  	    (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
        (or (setq tcp-connection
--- 91,104 ----
  	    (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 using
! the method specified in `spam-report-url-ping-function' for actually
! doing this."
!   (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
***************
*** 94,99 ****
--- 112,125 ----
        (process-send-string 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)
  

[-- Attachment #3: Type: text/plain, Size: 82 bytes --]


-Eric
-- 
"Excuse me --- Di Du Du Duuuuh Di Dii --- Huh Weeeheeee" (Albert King)

  reply	other threads:[~2003-09-10  6:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-09  6:47 Eric Knauel
2003-09-09 16:51 ` Reiner Steib
2003-09-09 18:13   ` Ted Zlatanov
2003-09-09 18:19     ` Ted Zlatanov
2003-09-09 19:50       ` Reiner Steib
2003-09-09 18:16 ` Ted Zlatanov
2003-09-10  6:52   ` Eric Knauel [this message]
2003-09-10 10:18     ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vw33cf5jftf.fsf@informatik.uni-tuebingen.de \
    --to=knauel@informatik.uni-tuebingen.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).