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
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk