Subject: [sup-talk] Spam hooks.

From: [email-masked] (Richard Heycock)
Date: Wed, 09 Apr 2008 20:07:36 +1000

I usr dspam as my anti-spam filter and I have it set up so that if
I forward a spam message to spam at domain it retrains the spam filter.

Is it possible to add a hook so that when I press 'S' to mark the
message as spam that it then forward the email to the appropriate
address.

rgh

-- 
+61 (0) 410 646 369
rgh at neoss.com.au

You're worried criminals will continue to penetrate into cyberspace, and
I'm worried complexity, poor design and mismanagement will be there to meet
them - Marcus Ranum

!DSPAM:47fc9568198723040813034!

---

From: [email-masked] (Ian Taylor)
Date: Wed, 09 Apr 2008 06:19:22 -0400

> message as spam that it then forward the email to the appropriate

Is there any way you could document your spam filtering setup on the
wiki?

http://sup.rubyforge.org/wiki/wiki.pl

-- 
Ian Taylor

---

From: [email-masked] (Marcus Williams)
Date: Wed, 09 Apr 2008 21:00:38 +0100

> message as spam that it then forward the email to the appropriate

Note that 'S' is actually marking a thread as a spam _not_ a message
as a spam so any hook would be working on (potentially) a set of
messages.

In my local edits I have a hook that allows for this, but its not
going to forward anything for you - it leaves it up to you to do what
you want with the thread. It wouldnt be that hard to iterate over the
thread and forward all messages to an address in ruby though.

I can clean it up and post it if its any help.

Marcus

---

From: [email-masked] (Richard Heycock)
Date: Thu, 10 Apr 2008 07:08:46 +1000

> as a spam so any hook would be working on (potentially) a set of

Yeah, ok.

> I can clean it up and post it if its any help.

That would be great. I just need the basic idea and I should be able
to take it form there.

rgh

-- 
+61 (0) 410 646 369
rgh at neoss.com.au

!DSPAM:47fd305e198721115333888!

---

From: [email-masked] (William Morgan)
Date: Wed, 09 Apr 2008 21:05:55 -0700

> thread and forward all messages to an address in ruby though.

I'd be happy to merge in such a hook if you want to send a patch.

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Marcus Williams)
Date: Thu, 10 Apr 2008 11:37:36 +0100

> That would be great. I just need the basic idea and I should be able

... patch is winging its way to sup-talk as I write this. Its against
next but it should patch cleanly against master. Some quick pointers
for the mark-as-spam.rb:

# ---- $HOME/.sup/hooks/mark-as-spam.rb ------

# simple actions on spam - use in hook and receive lots of logging
# when you hit 'S' :) 

#
# Sup marks a thread as spam, not a single message so this hook
# gets a thread passed to it.

log "Thread subject is #{thread.subj}"
log "Thread authors are #{thread.authors.join ', '}"

# latest message

log "Latest message in thread is #{thread.latest_message.subj}"

# all messages

thread.each { |m, *d| log "Look a message #{m.id}" if m }

# When you have a message object, you can do something with a complete
# message using the raw_* methods (untested..)

#      File.open(filename, "w") do |f|
#        m.each_raw_message_line { |l| f.print l }
#      end
#
#      ... now process the file somehow

# EOF -- $HOME/.sup/hooks/mark-as-spam.rb ------

HTH

Marcus

---

From: [email-masked] (Marcus Williams)
Date: Thu, 10 Apr 2008 12:04:32 +0100

> next but it should patch cleanly against master. Some quick pointers

Note that perhaps I should also add that this hook gets run on "toggle"
of the spam flag. So you probably want to check which way its been
toggled by looking for the :spam flag in the labels set if you want to
be extra careful. I think you can probably just use the thread
object's labels to do this.

Marcus

---

From: [email-masked] (Richard Heycock)
Date: Thu, 10 Apr 2008 23:05:15 +1000

> I'd be happy to merge in such a hook if you want to send a patch.

Sounds good. I'll give it a go over the weekend.

rgh

-- 
+61 (0) 410 646 369
rgh at neoss.com.au

!DSPAM:47fe108b198728455610660!

---

From: [email-masked] (Richard Heycock)
Date: Thu, 10 Apr 2008 23:09:04 +1000

> > next but it should patch cleanly against master. Some quick pointers

I had a quick look and it doesn't seem too onerous.

> object's labels to do this.

Ok.

dspam allows you to also retrain on false positives as well so it would
be worth detecting which way the spam toggle was and either send a
message to spam if it's spam and ham if it's not.

rgh

-- 
+61 (0) 410 646 369
rgh at neoss.com.au

!DSPAM:47fe1170198729375562959!