Gnus development mailing list
 help / color / mirror / Atom feed
From: Daniel Pittman <daniel@rimspace.net>
Subject: Re: Gnus SPAM support, and email based reporting.
Date: Sat, 15 May 2004 23:27:27 +1000	[thread overview]
Message-ID: <87lljt2534.fsf@enki.rimspace.net> (raw)
In-Reply-To: <4nzn95gwu7.fsf@lifelogs.com>

On 22 Apr 2004, Ted Zlatanov wrote:
> On Sat, 17 Apr 2004, Derrell.Lipman@unwireduniverse.com wrote:
>
>> Daniel Pittman <daniel@rimspace.net> writes:
>>
>>> So, to report an incorrectly classified message, I need to resend
>>> the message as-is to a specific address on the server, then delete
>>> it locally.
>>
>> I would begin using the gnus spam support as well, if that feature
>> were available!  (I haven't seen anything indicating that it is.)
>
> We can add something like Jochen Kupper's code to spam-report.el if
> everyone is OK with it.  Patches are preferred, I won't be able to
> get to it right away.

Well, having a quick poke around turned up some bits and pieces of code
that I got to do the right thing pretty easily in terms of doing the
resend...

I had a look at spam.el to see if I could work out how to hook it up to
the actual spam mark stuff and, boy, was that a shock.

I got lost somewhere around the second or third abstraction around what
really did look like very much the same code.

Ah, well.  Hopefully someone who knows the code better can point the way
to getting this registered to process spam messages on exit, and post a
short howto guide that tells me:

1. how to get the spam mark code activated
2. how to get the 'report by resend' code used
3. how to *not* use any of the other features

Thanks,
        Daniel

Index: spam-report.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/spam-report.el,v
retrieving revision 7.7
diff -u -u -r7.7 spam-report.el
--- spam-report.el	25 Feb 2004 23:53:49 -0000	7.7
+++ spam-report.el	15 May 2004 13:22:15 -0000
@@ -79,6 +79,13 @@
   :type 'file
   :group 'spam-report)
 
+
+(defcustom spam-report-resend-to nil
+  "Email address that spam articles are resent to when reporting."
+  :type 'string
+  :group 'spam-report)
+
+
 (defvar spam-report-url-ping-temp-agent-function nil
   "Internal variable for `spam-report-agentize' and `spam-report-deagentize'.
 This variable will store the value of `spam-report-url-ping-function' from
@@ -108,6 +115,23 @@
 		(spam-report-url-ping host report))
 	    (gnus-message 3 "Could not find X-Report-Spam in article %d..."
 			  article)))))))
+
+
+(defun spam-report-resend (&rest articles)
+  "Report an article as spam by resending via email."
+  (dolist (article articles)
+    (gnus-message 6 "Reporting spam article %d to <%s>..." article spam-report-resend-to)
+    ;; This is ganked from the `gnus-summary-resend-message' function.
+    ;; It involves rendering the SPAM, which is undesirable, but there does
+    ;; not seem to be a nicer way to achieve this to my limited knowledge.
+    ;; -- <daniel@rimspace.net>
+    ;; select this particular article
+    (gnus-summary-select-article nil nil nil article)
+    ;; resend it to the destination address
+    (save-excursion
+      (set-buffer gnus-original-article-buffer)
+      (message-resend spam-report-resend-to))))
+    
 
 (defun spam-report-url-ping (host report)
   "Ping a host through HTTP, addressing a specific GET resource using

-- 
It is preoccupation with possessions, more than anything else,
that prevents us from living freely and nobly.
        -- Bertrand Russell




  parent reply	other threads:[~2004-05-15 13:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-17 12:40 Daniel Pittman
2004-04-17 15:20 ` Derrell.Lipman
2004-04-21 15:44   ` Ted Zlatanov
2004-04-22  9:10     ` Steinar Bang
     [not found]       ` <87fzawgyxq.fsf-1rLz5CwDoL8@public.gmane.org>
2004-04-22 16:23         ` Jochen Küpper
2004-04-22 20:11           ` Ted Zlatanov
     [not found]             ` <4n1xmfept2.fsf-mIZUurteI1BWk0Htik3J/w@public.gmane.org>
2004-04-22 21:32               ` Jochen Küpper
2004-04-23 16:15                 ` Ted Zlatanov
2004-04-22 18:35       ` Ted Zlatanov
2004-04-23  5:34         ` Steinar Bang
2004-04-23  7:45           ` Daniel Pittman
2004-04-23 16:17           ` Ted Zlatanov
2004-05-15 13:27     ` Daniel Pittman [this message]
2004-05-18 20:08       ` Ted Zlatanov
2004-05-24 11:09         ` Daniel Pittman
2004-05-24 11:39           ` Kai Grossjohann
2004-05-24 14:07             ` Daniel Pittman
2004-05-24 14:12               ` Kai Grossjohann
2004-05-26 19:00                 ` Michael Schierl
2004-05-24 13:44           ` Ted Zlatanov
2004-05-24 14:18             ` Daniel Pittman
2004-05-24 17:40               ` Ted Zlatanov
2004-05-24 18:07                 ` Daniel Pittman
2004-05-24 18:50                   ` Ted Zlatanov
2004-05-24 18:52             ` spam.el processor code refactored (was: Gnus SPAM support, and email based reporting.) Ted Zlatanov
     [not found] ` <87isfy7p6a.fsf-kiwxAyAbAnkGAYDEi5AF0l6hYfS7NtTn@public.gmane.org>
2004-04-18 22:05   ` Gnus SPAM support, and email based reporting Jochen Küpper

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=87lljt2534.fsf@enki.rimspace.net \
    --to=daniel@rimspace.net \
    /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).