From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/57681 Path: main.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnus SPAM support, and email based reporting. Date: Tue, 25 May 2004 00:18:21 +1000 Sender: ding-owner@lists.math.uh.edu Message-ID: <87isellxhu.fsf@enki.rimspace.net> References: <87isfy7p6a.fsf@enki.rimspace.net> <1xmm1vhg.fsf@random.localnet.unwireduniverse.com> <4nzn95gwu7.fsf@lifelogs.com> <87lljt2534.fsf@enki.rimspace.net> <4nfz9xbirq.fsf@lifelogs.com> <87d64uaxpg.fsf@enki.rimspace.net> <4naczyj5xf.fsf@lifelogs.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1085408342 31536 80.91.224.253 (24 May 2004 14:19:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 May 2004 14:19:02 +0000 (UTC) Original-X-From: ding-owner+M6221@lists.math.uh.edu Mon May 24 16:18:53 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BSGI0-0001Dh-00 for ; Mon, 24 May 2004 16:18:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1BSGHm-0008Tx-00; Mon, 24 May 2004 09:18:38 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1BSGHh-0008Ts-00 for ding@lists.math.uh.edu; Mon, 24 May 2004 09:18:33 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1BSGHg-0007vN-WB for ding@lists.math.uh.edu; Mon, 24 May 2004 09:18:33 -0500 Original-Received: from anu.rimspace.net (203-217-29-35.perm.iinet.net.au [203.217.29.35]) by justine.libertine.org (Postfix) with ESMTP id BA1A63A0036 for ; Mon, 24 May 2004 09:18:30 -0500 (CDT) Original-Received: by anu.rimspace.net (Postfix, from userid 10) id 973424BB41; Tue, 25 May 2004 00:18:28 +1000 (EST) Original-Received: by enki.rimspace.net (Postfix, from userid 1000) id F393F150B72; Tue, 25 May 2004 00:18:21 +1000 (EST) Original-To: ding@gnus.org In-Reply-To: <4naczyj5xf.fsf@lifelogs.com> (Ted Zlatanov's message of "24 May 2004 09:44:28 -0400") User-Agent: Gnus/5.110003 (No Gnus v0.3) XEmacs/21.4 (Security Through Obscurity, linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:57681 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:57681 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