You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Andrea Bencini <an...@tin.it> on 2008/02/07 19:39:00 UTC

score

I installed postfix-2.4.5-2.fc8, amavisd-new-2.5.2-2.fc8 and
spamassassin-3.2.3-2.fc8.
They are running.
I would like to test spam changing "score" in local.cf.
My local.cf is:

report_safe 0
use_bayes 1
use_bayes_rules 1
skip_rbl_checks 0
bayes_path /var/spool/amavisd/.spamassassin/bayes
score FREE_PORN 1000
score LIVE_PORN 1100

Now I send an e-mail where there are  the words "porno" and "sex" in the
message body.

I receive the e-mail via postfix/amavisd and in the message header there are
X-Spam-Flag: NO
X-Spam-Score: 3.181
X-Spam-Level: ***
X-Spam-Status: No, score=3.181 tagged_above=0 required=5 tests=[AWL=-0.320,
 BAYES_99=3.5, STOX_REPLY_TYPE=0.001]

Why there aren't  FREE_PORN and LIVE_PORN scores?

Thanks
Andrea


Re: score

Posted by Theo Van Dinter <fe...@apache.org>.
On Thu, Feb 07, 2008 at 07:39:00PM +0100, Andrea Bencini wrote:
> Now I send an e-mail where there are  the words "porno" and "sex" in the
> message body.
> 
> Why there aren't  FREE_PORN and LIVE_PORN scores?

Because the single words "porno" and "sex" don't trigger the rules.  There are
few rules that trigger on a single word, and in this case, neither porn nor
sex is necessarily indicative of spam.

Single word spaminess is handled best by Bayes, and the mail received a
BAYES_99 rule hit.

-- 
Randomly Selected Tagline:
"The porcupine with the sharpest quills gets stuck on a tree more often."

Re: score

Posted by "McDonald, Dan" <Da...@austinenergy.com>.
On Fri, 2008-02-08 at 11:03 -0800, Paul Douglas Franklin of Yakima UGM
wrote:
> Can you point me to a good regex tutorial?

Have you tried `perldoc perlretut` ?



>   The one I have found has 
> given me a lot of good starting stuff, but it doesn't mention the ?:, 
> and I'd like to learn more.
from perlretut...

 Non-capturing groupings

       We noted in Part 1 that groupings "()" had two distinct
functions: 1) group regexp elements together as a single unit, and 2)
       extract, or capture, substrings that matched the regexp in the
grouping.  Non-capturing groupings, denoted by "(?:regexp)", allow
       the regexp to be treated as a single unit, but don't extract
substrings or set matching variables $1, etc.  Both capturing and
       non-capturing groupings are allowed to co-exist in the same
regexp.  Because there is no extraction, non-capturing groupings are
       faster than capturing groupings....

-- 
Daniel J McDonald, CCIE #2495, CISSP #78281, CNX
Austin Energy
http://www.austinenergy.com


Re: score

Posted by Theo Van Dinter <fe...@apache.org>.
On Fri, Feb 08, 2008 at 11:03:26AM -0800, Paul Douglas Franklin of Yakima UGM wrote:
> Can you point me to a good regex tutorial?  The one I have found has 
> given me a lot of good starting stuff, but it doesn't mention the ?:, 
> and I'd like to learn more.

$ perldoc perlre

-- 
Randomly Selected Tagline:
"The Internet is like crack for smart people."    - Arsenio Hall

Re: score

Posted by Matt Kettler <mk...@verizon.net>.
Paul Douglas Franklin of Yakima UGM wrote:
> Can you point me to a good regex tutorial?  The one I have found has 
> given me a lot of good starting stuff, but it doesn't mention the ?:, 
> and I'd like to learn more.
?: is a Perl extension that disables generating a back reference.. 
normally anything in () can be re-referenced with \1 \2, etc depending 
on which set of ()'s it is.

So /(a|b)\1/ would match aa and bb but not ab.

But if you don't intend to use a back reference, storing it is just 
wasting memory.

As for regex references, there's several in the wiki article on rule 
writing. You'll also find many of the basic constructs used in SA rules 
explained in this article:

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

Disclaimer: I wrote much of the text here, so I am not unbiased...


Re: score

Posted by Paul Douglas Franklin of Yakima UGM <pd...@yugm.org>.
Can you point me to a good regex tutorial?  The one I have found has 
given me a lot of good starting stuff, but it doesn't mention the ?:, 
and I'd like to learn more.
--Thanks.

Matt Kettler wrote:
> The regex for the rule is:
> /\bfree (?:porn|xxx|adult)/i

-- 
Paul Douglas Franklin
Computer Manager, Union Gospel Mission of Yakima, Washington
Husband of Danette
Father of Laurene, Miriam, Tycko, Timothy, Sarabeth, Marie, Dawnita, Anna Leah, Alexander, and Caleb


Re: score

Posted by Matt Kettler <mk...@verizon.net>.
Andrea Bencini wrote:
> I installed postfix-2.4.5-2.fc8, amavisd-new-2.5.2-2.fc8 and
> spamassassin-3.2.3-2.fc8.
> They are running.
> I would like to test spam changing "score" in local.cf.
> My local.cf is:
>
> report_safe 0
> use_bayes 1
> use_bayes_rules 1
> skip_rbl_checks 0
> bayes_path /var/spool/amavisd/.spamassassin/bayes
> score FREE_PORN 1000
> score LIVE_PORN 1100
>
> Now I send an e-mail where there are  the words "porno" and "sex" in the
> message body.
FREE_PORN triggers on that two-word phrase, not just "porno"

The regex for the rule is:
 /\bfree (?:porn|xxx|adult)/i

So, it will catch "free" followed (immediately) by porn, xxx or adult.

LIVE_PORN works in a similar fashion.