You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Simon <gr...@gmail.com> on 2006/11/09 23:31:05 UTC

ruleset question (sa-update and custom rulesets)

Hi All,

First off, running SpamAssassin version 3.1.3 (backports.org), running
on Perl version 5.8.4 thru amavisd-new-2.4 on debian sarge.

I have two directories where there are SA rulesets:

/usr/share/spamassassin/
/var/lib/spamassassin/3.001003/updates_spamassassin_org/

These contain files 10_etc 20_etc. I understand these, so no issues
there. My questions are:

- How do i confirm that SA is using the rulesets from sa-update?

- If i want to put in some custom ones... where is the best to do this?

- Do i put any custom stuff in one file and get it to load last? (Best
practice?)

Thanks!!!

Simon

Re: ruleset question (sa-update and custom rulesets)

Posted by Simon <gr...@gmail.com>.
On 11/10/06, Theo Van Dinter <fe...@apache.org> wrote:
> On Fri, Nov 10, 2006 at 12:21:12PM +1300, Simon wrote:
> > >You can put it in any files you want.  /etc/mail/spamassassin/*.cf is read
> > >last.
> >
> > Cool - so to build a custom rule to block emails with a subject:
> > It's Johnny :)
> [...]
> > I create a file /etc/mail/spamassassin/custom_sa_rules
>
> custom_sa_rules.cf
>
> > header    ITS_NAME_SMILEY   Subject =~ /\bIt\'s\b\:)/i
>
> Sure, if you want to.  However, the rule's not going to match the text
> you've specified.  \b is a word boundary, not whitespace, which is \s.
> You also escape some things which don't need it ("'" and ":") and don't
> escape other things which do need it (")").

Ah Ha!

Thanks for the tips, would you be able to check (please!) if ive got
it right now?

Subject =~ /\bIt"'"s\s*\s")"";"/i

Which is: "It's AnyWord :)"

(I think!)

Simon

Re: ruleset question (sa-update and custom rulesets)

Posted by Theo Van Dinter <fe...@apache.org>.
On Fri, Nov 10, 2006 at 12:21:12PM +1300, Simon wrote:
> >You can put it in any files you want.  /etc/mail/spamassassin/*.cf is read
> >last.
> 
> Cool - so to build a custom rule to block emails with a subject:
> It's Johnny :)
[...]
> I create a file /etc/mail/spamassassin/custom_sa_rules

custom_sa_rules.cf

> header    ITS_NAME_SMILEY   Subject =~ /\bIt\'s\b\:)/i

Sure, if you want to.  However, the rule's not going to match the text
you've specified.  \b is a word boundary, not whitespace, which is \s.
You also escape some things which don't need it ("'" and ":") and don't
escape other things which do need it (")").

-- 
Randomly Selected Tagline:
 Paul: Good way to avoid frostbite, folks, put your hands between 
  your buttocks. That's nature's pocket. 

Re: ruleset question (sa-update and custom rulesets)

Posted by Simon <gr...@gmail.com>.
On 11/10/06, Theo Van Dinter <fe...@apache.org> wrote:
> On Fri, Nov 10, 2006 at 11:31:05AM +1300, Simon wrote:
> > - How do i confirm that SA is using the rulesets from sa-update?
>
> spamassassin --lint -D
>
> > - If i want to put in some custom ones... where is the best to do this?
>
> /etc/mail/spamassassin
>
> > - Do i put any custom stuff in one file and get it to load last? (Best
> > practice?)
>
> You can put it in any files you want.  /etc/mail/spamassassin/*.cf is read
> last.

Cool - so to build a custom rule to block emails with a subject:

It's Johnny :)
It's David :)
It's Sue :)

Etc...

I create a file /etc/mail/spamassassin/custom_sa_rules

And put this in?

header    ITS_NAME_SMILEY   Subject =~ /\bIt\'s\b\:)/i
describe  ITS_NAME_SMILEY   Its Name Smiley in Subject
score      ITS_NAME_SMILEY   6.5

?
Thanks

Simon

Re: ruleset question (sa-update and custom rulesets)

Posted by Theo Van Dinter <fe...@apache.org>.
On Fri, Nov 10, 2006 at 11:31:05AM +1300, Simon wrote:
> - How do i confirm that SA is using the rulesets from sa-update?

spamassassin --lint -D

> - If i want to put in some custom ones... where is the best to do this?

/etc/mail/spamassassin

> - Do i put any custom stuff in one file and get it to load last? (Best
> practice?)

You can put it in any files you want.  /etc/mail/spamassassin/*.cf is read
last.

-- 
Randomly Selected Tagline:
"6+2=8.  Now describe why."            - Joe about his Calculus class