Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: marcus-sup@quintic.co.uk (Marcus Williams)
Subject: [sup-talk] [PATCH] New hook (enabling message filters)
Date: Fri, 19 Oct 2007 15:18:37 +0100	[thread overview]
Message-ID: <4718BCBD.2030307@quintic.co.uk> (raw)
In-Reply-To: <4d7f58120018376f@IMSS-WIN>

On 19/10/2007 David Stubbs wrote:
> There are a few things I want to get sorted spam filtering is one of
>  them. I'm assuming I'll be able to use your new patch to do spam
> filtering.

Yep, you can mark things directly as spam by adding the spam label I
think, although I've not tried this yet. You could also kill a message
by adding killed as a label.

So assuming your spam checker adds "SPAM" or something to the subject
you can just do:

message.add_label "spam" if message.subj =~ /SPAM/

I think you can also use the message.raw_headers to look for specific
headers (like X-Spam-Status if you're using spamassassin).

I'm not sure if the reserved labels like spam/killed etc can be added as
strings or if you have to add them as symbols :spam or :killed - they're
symbols in the code but they may get converted into strings when added
to the index. Easy enough to test though.

Marcus


  parent reply	other threads:[~2007-10-19 14:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19 10:52 Marcus Williams
2007-10-19 12:51 ` David Stubbs
     [not found] ` <4d4780f700181787@IMSS-WIN>
2007-10-19 13:46   ` Marcus Williams
     [not found]   ` <4d6e9e1600182d59@IMSS-WIN>
2007-10-19 13:50     ` Marcus Williams
2007-10-19 14:03       ` David Stubbs
     [not found]       ` <4d7f58120018376f@IMSS-WIN>
2007-10-19 14:18         ` Marcus Williams [this message]
2007-10-19 14:21           ` David Stubbs
2007-11-05  2:40       ` William Morgan
2007-11-05 15:03         ` Marcus Williams
2007-11-05 15:38           ` William Morgan

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=4718BCBD.2030307@quintic.co.uk \
    --to=marcus-sup@quintic.co.uk \
    /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