Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: marcus-sup@bar-coded.net (Marcus Williams)
Subject: [sup-talk] Spam hooks.
Date: Thu, 10 Apr 2008 11:37:36 +0100	[thread overview]
Message-ID: <1207823540-sup-3480@tomsk> (raw)
In-Reply-To: <1207775231-sup-6370@wrasse>

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


  reply	other threads:[~2008-04-10 10:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-09 10:07 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 [this message]
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

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=1207823540-sup-3480@tomsk \
    --to=marcus-sup@bar-coded.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