RE: e greeting exe link [SOLVED]

2008-08-27 Thread Michael Hutchinson
> -Original Message-
> From: Matt Kettler [mailto:[EMAIL PROTECTED]
> Sent: 28 August 2008 1:49 p.m.
> To: Michael Hutchinson
> Cc: users@spamassassin.apache.org
> Subject: Re: e greeting exe link
> 
> Michael Hutchinson wrote:
> >
> > But only match it from the last trailing / character. In other
words, if
> > the message carries a link to "card.exe" at any address, it will be
> > marked up.
> >
> > My thoughts were that all I would need is a rule like:
> > uri MY_EXE_URI /card.exe/i
> >
> Caution: . is a wildcard, so the above will match "card exe"
"card1exe"
> etc.
> 
> Add a \ to force it to be a literal period character.
> 
> uri MY_EXE_URI /card\.exe/i
> 
> That still runs some risk of matching things you don't want, like
parts
> of the domain, etc.
> 
> I might tighten it up a bit more by adding the / in. trying to match
> "/card.exe" instead of just "card.exe"
> Again, we need a \ or the / will be interpreted as the end of the
> expression, so we add \/
> 
> uri MY_EXE_URI /\/card\.exe/i

That's got it sorted - precisely what I'm after.. Thank-you Matt for
clearing this up! I'm going to employ some new rules straight away :)


> > Or do I need to actually match all of the stuff before that, using a
> > wildcard for example?
> >
> No, you don't. Regexes will match a substring. Adding .* to the
> beginning or end of a regex is a superfluous waste, and has no affect
> whatsoever on the strings matched.
> 
> ( note:  .* is regex syntax for 0 or more wildcards, equivalent to a
> command-line *)

Yay, I thought the complicating matching of http or ftp links in the
original rule were unnecessary.

Nice, that's going to help me tidy up some of my other custom rules.
Once again, Thank-you Matt for the clarity on this issue.  -
happy SA user.

Cheers,
Michael Hutchinson
Manux Solutions.


Re: e greeting exe link [SOLVED]

2008-08-27 Thread Matt Kettler
Michael Hutchinson wrote:
>
> Nice, that's going to help me tidy up some of my other custom rules.
> Once again, Thank-you Matt for the clarity on this issue.  -
> happy SA user.
>   
No problem.

One final suggestion. Take some time to read:

http://wiki.apache.org/spamassassin/WritingRules

This covers many of these topics.