Gnus development mailing list
 help / color / mirror / Atom feed
From: Daniel Pittman <daniel@rimspace.net>
Subject: Re: spam.el reporting and moving ham out of spam groups.
Date: Thu, 27 May 2004 16:15:21 +1000	[thread overview]
Message-ID: <877juypf9i.fsf@enki.rimspace.net> (raw)
In-Reply-To: <4nekp7jhc9.fsf@lifelogs.com>

On 27 May 2004, Ted Zlatanov wrote:
> On Tue, 25 May 2004, daniel@rimspace.net wrote:

[...]

>> What I would like to achieve is that anything marked as unread is
>> reported as ham (by email :) and then respooled on exit from the spam
>> group.
>>
>> Everything else will be killed or marked read, then total-expired.
>> I would rather *not* give everything the spam mark on entry either,
>> since I use score files to really obvious stuff as read.
>
>> Unfortunately, it doesn't seem possible to set spam.el to process
>> messages as ham without setting the group classification as 'spam'.
>
> Can you try spam-process-ham-in-nonham-groups?

Well, I suppose I could for the spirit of scientific inquiry, if you
wish, but...

>> Setting the group as 'spam' means that everything gets the spam mark on
>> entry...
>>
>> Is there a way around this, or am I asking the impossible?
>
> Nothing is impossible, except skiing through a revolving door :)
>
> I just added a new variable,
> spam-mark-new-messages-in-spam-group-as-spam which is t by default.
> If you set it to nil, you'll get the effect you want.

...with this set to `t', spam.el deals with mail the way I want with my
spam catch-all classified as "spam", and everything else unclassified.

I did need to make a couple of changes to get `spam-report-by-resend' to
do the right thing with the new group parameter you added, though.

Your code would bind the result of searching for the group parameter as
the value of `spam-report-resend-to' unconditionally, which means that
where the group parameter did not exist, the value was `nil'.

This then triggered the "no set resend address" logic which, of course,
didn't actually set the variable as expected, resulting in things not
working as expected.

If there *was* a group parameter, the result was a list containing a
string with the destination address, not the address itself. That needed
to be unpacked before resending...

The following patch does these things, and it all works nicely for me now.

   Daniel

Index: spam.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/spam.el,v
retrieving revision 7.44
diff -u -u -r7.44 spam.el
--- spam.el	26 May 2004 16:38:07 -0000	7.44
+++ spam.el	27 May 2004 06:08:20 -0000
@@ -779,9 +779,10 @@
 Respects the process/prefix convention.  Also see
 `spam-report-resend-to'."
   (interactive "P")
-  (let ((spam-report-resend-to 
-	 (gnus-parameter-spam-resend-to gnus-newsgroup-name))
-	(articles (gnus-summary-work-articles n)))
+  (let* ((spam-report-resend-to-group-param (gnus-parameter-spam-resend-to gnus-newsgroup-name))
+         (spam-report-resend-to (or (nth 0 spam-report-resend-to-group-param)
+                                    spam-report-resend-to))
+         (articles (gnus-summary-work-articles n)))
     (spam-report-resend articles)
     (dolist (article articles)
       (gnus-summary-remove-process-mark article))))
@@ -2114,8 +2115,11 @@
     (apply 'spam-report-gmane articles)))
 
 (defun spam-report-resend-register-routine (articles)
-  (let ((spam-report-resend-to (gnus-parameter-spam-resend-to gnus-newsgroup-name)))
-	(spam-report-resend articles)))
+  (let* ((resend-to-gp (gnus-parameter-spam-resend-to gnus-newsgroup-name))
+         (spam-report-resend-to (or (and (listp resend-to-gp)
+                                         (nth 0 resend-to-gp))
+                                    spam-report-resend-to)))
+    (spam-report-resend articles)))
 
 \f
 ;;;; Bogofilter


-- 
You must not quote to me what I once said. I am wiser now.
        -- Romy Schneider (1966)




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

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-25 13:17 Daniel Pittman
2004-05-25 14:14 ` Kai Grossjohann
2004-05-26  4:41   ` Daniel Pittman
2004-05-26 16:17     ` Ted Zlatanov
2004-05-25 15:37 ` Adam Sjøgren
2004-05-26  4:46   ` Daniel Pittman
2004-05-26  8:38     ` Adam Sjøgren
2004-05-26 16:16   ` Ted Zlatanov
2004-05-26 20:29     ` Adam Sjøgren
2004-05-28 19:52       ` Adam Sjøgren
2004-06-07 17:12         ` Ted Zlatanov
2004-06-07 18:15           ` Adam Sjøgren
2004-06-08 14:24             ` Ted Zlatanov
2004-05-26 16:14 ` Ted Zlatanov
2004-05-26 20:23   ` Miles Bader
2004-05-27  6:15   ` Daniel Pittman [this message]
2004-05-27 14:35     ` 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=877juypf9i.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).