From mboxrd@z Thu Jan 1 00:00:00 1970 From: stubbsd@zetani.com (David Stubbs) Date: Fri, 19 Oct 2007 15:21:50 +0100 Subject: [sup-talk] [PATCH] New hook (enabling message filters) In-Reply-To: <4718BCBD.2030307@quintic.co.uk> References: <47188C6F.30008@quintic.co.uk> <4d4780f700181787@IMSS-WIN> <4d6e9e1600182d59@IMSS-WIN> <4718B60F.1090208@quintic.co.uk> <4d7f58120018376f@IMSS-WIN> <4718BCBD.2030307@quintic.co.uk> Message-ID: <1192803670-sup-9751@DASMac.local> Excerpts from Marcus Williams's message of Fri Oct 19 15:18:37 +0100 2007: > 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 Funky, I'll give it a go!