Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Spam hooks.
@ 2008-04-09 10:07 Richard Heycock
  2008-04-09 10:19 ` Ian Taylor
  2008-04-09 20:00 ` Marcus Williams
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Heycock @ 2008-04-09 10:07 UTC (permalink / raw)


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!




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [sup-talk] Spam hooks.
  2008-04-09 10:07 [sup-talk] Spam hooks Richard Heycock
@ 2008-04-09 10:19 ` Ian Taylor
  2008-04-09 20:00 ` Marcus Williams
  1 sibling, 0 replies; 9+ messages in thread
From: Ian Taylor @ 2008-04-09 10:19 UTC (permalink / raw)


Excerpts from Richard Heycock's message of Wed Apr 09 06:07:36 -0400 2008:
> 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!
> 

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

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

-- 
Ian Taylor


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [sup-talk] Spam hooks.
  2008-04-09 10:07 [sup-talk] Spam hooks Richard Heycock
  2008-04-09 10:19 ` Ian Taylor
@ 2008-04-09 20:00 ` Marcus Williams
  2008-04-09 21:08   ` Richard Heycock
  2008-04-10  4:05   ` William Morgan
  1 sibling, 2 replies; 9+ messages in thread
From: Marcus Williams @ 2008-04-09 20:00 UTC (permalink / raw)


On 9.4.2008, Richard Heycock wrote:
> 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.

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [sup-talk] Spam hooks.
  2008-04-09 20:00 ` Marcus Williams
@ 2008-04-09 21:08   ` Richard Heycock
  2008-04-10 10:37     ` Marcus Williams
  2008-04-10  4:05   ` William Morgan
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Heycock @ 2008-04-09 21:08 UTC (permalink / raw)


Excerpts from Marcus Williams's message of Thu Apr 10 06:00:38 +1000 2008:
> On 9.4.2008, Richard Heycock wrote:
> > 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.
> 
> 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.

Yeah, ok.

> 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.

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

rgh

> Marcus

-- 
+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:47fd305e198721115333888!




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [sup-talk] Spam hooks.
  2008-04-09 20:00 ` Marcus Williams
  2008-04-09 21:08   ` Richard Heycock
@ 2008-04-10  4:05   ` William Morgan
  2008-04-10 13:05     ` Richard Heycock
  1 sibling, 1 reply; 9+ messages in thread
From: William Morgan @ 2008-04-10  4:05 UTC (permalink / raw)


Reformatted excerpts from Marcus Williams's message of 2008-04-09:
> 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'd be happy to merge in such a hook if you want to send a patch.

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [sup-talk] Spam hooks.
  2008-04-09 21:08   ` Richard Heycock
@ 2008-04-10 10:37     ` Marcus Williams
  2008-04-10 11:04       ` Marcus Williams
  0 siblings, 1 reply; 9+ messages in thread
From: Marcus Williams @ 2008-04-10 10:37 UTC (permalink / raw)


On 9.4.2008, Richard Heycock wrote:
> That would be great. I just need the basic idea and I should be able
> to take it form there.

... 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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [sup-talk] Spam hooks.
  2008-04-10 10:37     ` Marcus Williams
@ 2008-04-10 11:04       ` Marcus Williams
  2008-04-10 13:09         ` Richard Heycock
  0 siblings, 1 reply; 9+ messages in thread
From: Marcus Williams @ 2008-04-10 11:04 UTC (permalink / raw)


On 10.4.2008, I wrote:
> On 9.4.2008, Richard Heycock wrote:
> > That would be great. I just need the basic idea and I should be able
> > to take it form there.
> 
> ... 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:

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [sup-talk] Spam hooks.
  2008-04-10  4:05   ` William Morgan
@ 2008-04-10 13:05     ` Richard Heycock
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Heycock @ 2008-04-10 13:05 UTC (permalink / raw)


Excerpts from William Morgan's message of Thu Apr 10 14:05:55 +1000 2008:
> Reformatted excerpts from Marcus Williams's message of 2008-04-09:
> > 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'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

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:47fe108b198728455610660!




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [sup-talk] Spam hooks.
  2008-04-10 11:04       ` Marcus Williams
@ 2008-04-10 13:09         ` Richard Heycock
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Heycock @ 2008-04-10 13:09 UTC (permalink / raw)


Excerpts from Marcus Williams's message of Thu Apr 10 21:04:32 +1000 2008:
> On 10.4.2008, I wrote:
> > On 9.4.2008, Richard Heycock wrote:
> > > That would be great. I just need the basic idea and I should be able
> > > to take it form there.
> > 
> > ... 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:

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

> 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.

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

> Marcus

-- 
+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:47fe1170198729375562959!




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-04-10 13:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09 10:07 [sup-talk] Spam hooks Richard Heycock
2008-04-09 10:19 ` Ian Taylor
2008-04-09 20:00 ` Marcus Williams
2008-04-09 21:08   ` Richard Heycock
2008-04-10 10:37     ` Marcus Williams
2008-04-10 11:04       ` Marcus Williams
2008-04-10 13:09         ` Richard Heycock
2008-04-10  4:05   ` William Morgan
2008-04-10 13:05     ` Richard Heycock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox