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: Tue, 25 May 2004 00:18:21 +1000	[thread overview]
Message-ID: <87isellxhu.fsf@enki.rimspace.net> (raw)
In-Reply-To: <4naczyj5xf.fsf@lifelogs.com> (Ted Zlatanov's message of "24 May 2004 09:44:28 -0400")

On 24 May 2004, Ted Zlatanov wrote:
> On Mon, 24 May 2004, daniel@rimspace.net wrote:
> On 19 May 2004, Ted Zlatanov wrote:
>
>>> I'm planning to do a major overhaul (version 3 of spam.el, so to
>>> speak) where a lot of the unnecessary complexity is at least only
>>> done once.  Probably by the end of the year.
>>
>> It struck me that there was an awful lot of writing of wrapper functions
>> around what is, at heart, pipe to command A to learn as spam, or command
>> B to learn as ham.
>>
>> OTOH, I don't really understand your code so well and I am probably
>> missing the reason why a bunch of this complexity exists.
>
> The complexity is necessary to accomodate all the spam detection and
> training backends.  BBDB, for instance, is VERY different from
> Bogofilter.  Some backends don't detect incoming spam (the reporters),
> others don't learn (spam-use-blackholes).  Like I said, I'll try to
> simplify it, but the code will have to remain very abstract to handle
> all the possible backends.  There will probably be
> spam-register-backend which will handle all the various types of
> backends.

*nod*  I should say that I don't mean to criticize your work. Getting
this all hanging together seems like a large workload.  Thanks for doing
that.

[...]

>> Er, and finally, I think that it would be better to set `defcustom
>> spam-report-resend-to' to `nil' by default.
>>
>> Then, in the report function we could test that address and if it was
>> `nil', display an error to the user and instruct spam.el to mark the
>> article as "not processed"
>>
>> That seems more user-friendly to me.  Alternately, we could actually
>> prompt for the destination and save that with custom, but I don't know
>> how to do that - custom is still a mysterious (and probably explosive)
>> black box to me. :)
>
> The resend-to address should be a Gnus group/topic variable that
> overrides the default spam-report-resend-to, I think. What do you
> think?

I agree with that; it makes sense to be able to treat it just like the
other spam settings.  The default prompting thing would also be good,
though, for the better "out of the box" experience, I think.

Give me a minute...

...and this should implement precisely that.  No handling of the group
stuff yet, because I am not sure where that is best hooked in.

I *think* it would be best done by fetching it in the spam.el code, then
using `let' to bind `spam-report-resend-to' for the duration of the
call...

Feels good to be writing some code again. Mmmm, code.

        Daniel

Index: spam-report.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/spam-report.el,v
retrieving revision 7.9
diff -u -u -r7.9 spam-report.el
--- spam-report.el	20 May 2004 18:32:35 -0000	7.9
+++ spam-report.el	24 May 2004 14:16:53 -0000
@@ -79,11 +79,10 @@
   :type 'file
   :group 'spam-report)
 
-(defcustom spam-report-resend-to (or 
-				  (when (length user-mail-address) 
-				    user-mail-address)
-				  "nonexistent-user-please-fix@invalid.domain")
-  "Email address that spam articles are resent to when reporting."
+(defcustom spam-report-resend-to nil
+  "Email address that spam articles are resent to when reporting.
+If not set, the user will be prompted to enter a value which will be
+saved for future use."
   :type 'string
   :group 'spam-report)
 
@@ -93,8 +92,11 @@
 before `spam-report-agentize' was run, so that `spam-report-deagentize' can
 undo that change.")
 
-(defun spam-report-resend (&rest articles)
+(defun spam-report-resend (articles)
   "Report an article as spam by resending via email."
+  (unless spam-report-resend-to
+    (customize-set-variable spam-report-resend-to
+                            (read-from-minibuffer "email address to resend SPAM to? ")))
   (dolist (article articles)
     (gnus-message 6 
 		  "Reporting spam article %d to <%s>..." 
@@ -133,6 +135,7 @@
 		(spam-report-url-ping host report))
 	    (gnus-message 3 "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 true believer is eternally incomplete, eternally insecure.
        -- Eric Hoffer



  reply	other threads:[~2004-05-24 14:18 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
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 [this message]
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=87isellxhu.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).