Simon wrote:
> On 11/10/06, Theo Van Dinter <[EMAIL PROTECTED]> 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!)

Close, but no cigar.

Try this one (untested):

Subject =~ /\bIt's\s+[a-z]+\s*:\)/i

\b      Word boundry
It's    "It's"
\s+     At least one whitespace character
[a-z]+  At least one letter
\s*     Optional whitespace
:\)     ":)"

-- 
Bowie

Reply via email to