Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: SpamAssassin: users

Stupid questions V 2.0

 

 

SpamAssassin users RSS feed   Index | Next | Previous | View Threaded


spixxrocks at gmail

Jun 23, 2011, 12:38 AM

Post #1 of 8 (348 views)
Permalink
Stupid questions V 2.0

Hello!
I have started down the path of creating my own rulesets for a spamassassin
install. My questions is simple. If I for instance want to match on sevral
words how do I do that? This will be my "example":

Countries of interest: UK, Ireland, Austria, Sweden, Finland, Denmark,
Norway

We sell proprietary information reports on green technology, renewables and
alternative energy sources themes.

We are looking for companies to represent us in above mentioned countries.

You should be a company owner or a top management member, holding full power
of attorney of the said company.

The main activity will be managing receivables from our sales.

We offer a commission based colaboration, therefore tied directly to our
sales volumes.

Positive and long relationship with local or international financial
institutions is essential, we will enquire for references.
This is the body of the email and what I want to do is a rawbody or body
check that is triggered when green technology alternative energy sources is
in the body. But I do not want the spamscore added if they are in any other
combination.
What I'm looking for is a "map" like this:
&& = And
== = Really the same
Is there a guide or intro or documentation on the regexp or is it just
"standard" regexp?! I cannot find any info on howto write rules other than:
match on this exact word...

Regards Spixx
--
View this message in context: http://old.nabble.com/Stupid-questions-V-2.0-tp31909247p31909247.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


spixxrocks at gmail

Jun 23, 2011, 3:29 AM

Post #2 of 8 (347 views)
Permalink
Re: Stupid questions V 2.0 [In reply to]

Wünderbar!

I will check the META thanks for the pointer!


spixx_ wrote:
>
> Hello!
> I have started down the path of creating my own rulesets for a
> spamassassin install. My questions is simple. If I for instance want to
> match on sevral words how do I do that? This will be my "example":
>
> Countries of interest: UK, Ireland, Austria, Sweden, Finland, Denmark,
> Norway
>
> We sell proprietary information reports on green technology, renewables
> and alternative energy sources themes.
>
> We are looking for companies to represent us in above mentioned countries.
>
> You should be a company owner or a top management member, holding full
> power of attorney of the said company.
>
> The main activity will be managing receivables from our sales.
>
> We offer a commission based colaboration, therefore tied directly to our
> sales volumes.
>
> Positive and long relationship with local or international financial
> institutions is essential, we will enquire for references.
> This is the body of the email and what I want to do is a rawbody or body
> check that is triggered when green technology alternative energy sources
> is in the body. But I do not want the spamscore added if they are in any
> other combination.
> What I'm looking for is a "map" like this:
> && = And
> == = Really the same
> Is there a guide or intro or documentation on the regexp or is it just
> "standard" regexp?! I cannot find any info on howto write rules other
> than: match on this exact word...
>
> Regards Spixx
>

--
View this message in context: http://old.nabble.com/Stupid-questions-V-2.0-tp31909247p31910210.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


per at computer

Jun 23, 2011, 4:21 AM

Post #3 of 8 (340 views)
Permalink
Re: Stupid questions V 2.0 [In reply to]

spixx_ wrote:

[snip]
> Is there a guide or intro or documentation on the regexp or is it just
> "standard" regexp?! I cannot find any info on howto write rules other
> than: match on this exact word...

It is a standard regexp. You will also want to look at using meta rules
for logically combining rules with 'and' and 'or'. See "man
Mail::Spamassassin::Conf".


/Per Jessen, Zürich


Bowie_Bailey at BUC

Jun 23, 2011, 8:47 AM

Post #4 of 8 (339 views)
Permalink
Re: Stupid questions V 2.0 [In reply to]

On 6/23/2011 3:38 AM, spixx_ wrote:
> Hello!
> I have started down the path of creating my own rulesets for a spamassassin
> install. My questions is simple. If I for instance want to match on sevral
> words how do I do that?

SpamAssassin uses Perl regular expressions. There is lots of
information available on the Internet.

http://www.google.com/search?q=perl+regular+expressions

For your question, you can match on a list of words with an expression
like this:

/word1|word2|word3|word4/

However, keep in mind that without anchoring the expression, you can
match on substrings such as "blahword1blah". To avoid that, you can
match like this:

/\b(?:word1|word2|word3|word4)\b/

The "\b" matches a word boundary (beginning or ending of a word) and the
parenthesis group the alternates together so that the expression says
"word boundary, one of these words, then another word boundary". The
"?:" prevent the group from capturing the match and speeds it up a bit.

--
Bowie


spixxrocks at gmail

Jun 26, 2011, 11:53 PM

Post #5 of 8 (326 views)
Permalink
Re: Stupid questions V 2.0 [In reply to]

Thank you! This what was I was looking for!

rawbody GREEN_LIAISON1
/\b(?:proprietary|information|technology|renewables|alternative)\b/i
describe GREEN_LIAISON1 Remove the emails with green tech spies

rawbody GREEN_LIAISON2
/\b(?:Positive|relationship|international|institutions)\b/i
describe GREEN_LIAISON2 Remove the emails with green tech spies

header GREEN_LIAISON3 Subject =~
/\b(?:Green|renewables|technology|liaison)\b/i
describe GREEN_LIAISON3 Checking the header for more of the same

the rule that I've done so far, I'm going to make a stageing point for this
(match 1 and thats X point match 2 and thats X + Y points).

Not sure but I have to say that there is room for a good Howto on this
topic. I will try and push myself to learn more and then try and make one
for us dummies :)


Per Jessen wrote:
>
> spixx_ wrote:
>
> [snip]
>> Is there a guide or intro or documentation on the regexp or is it just
>> "standard" regexp?! I cannot find any info on howto write rules other
>> than: match on this exact word...
>
> It is a standard regexp. You will also want to look at using meta rules
> for logically combining rules with 'and' and 'or'. See "man
> Mail::Spamassassin::Conf".
>
>
> /Per Jessen, Zürich
>
>
>

--
View this message in context: http://old.nabble.com/Stupid-questions-V-2.0-tp31909247p31934928.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


dan.mcdonald at austinenergy

Jun 27, 2011, 6:49 AM

Post #6 of 8 (321 views)
Permalink
Re: Stupid questions V 2.0 [In reply to]

On 6/27/11 1:53 AM, "spixx_" <spixxrocks [at] gmail> wrote:

>
> Thank you! This what was I was looking for!
>
> rawbody

Not certain why you are using rawbody. I might suggest you use subtests and
tflags multiple:


E.g:

body __GREEN_LIAISON1
/\b(?:proprietary|information|technology|renewables|alternative)\b/i
describe __GREEN_LIAISON1 Remove the emails with green tech spies
tflags __GREEN_LIAISON1 multiple

body __GREEN_LIAISON2
/\b(?:Positive|relationship|international|institutions)\b/i
describe __GREEN_LIAISON2 Remove the emails with green tech spies
tflags __GREEN_LIAISON2 multiple


header __GREEN_LIAISON3 Subject =~
/\b(?:Green|renewables|technology|liaison)\b/i
describe __GREEN_LIAISON3 Checking the header for more of the same
tflags __GREEN_LIAISON3 multiple

meta GREEN_LIAISON __GREEN_LIAISON1 > 2 && __GREEN_LIAISON2 > 2 &&
__GREEN_LIAISON3 > 1
describe GREEN_LIAISON Contains a lot of words found in green tech scams

> Not sure but I have to say that there is room for a good Howto on this
> topic. I will try and push myself to learn more and then try and make one
> for us dummies :)

A howto on writing rules? Or on perl regular expressions in general? If
you just want to understand perl regular expressions, there is no better
place to start than perldoc perlretut

--
Daniel J McDonald, CCIE # 2495, CISSP # 78281


spixxrocks at gmail

Jun 27, 2011, 7:12 AM

Post #7 of 8 (323 views)
Permalink
Re: Stupid questions V 2.0 [In reply to]

More on the science of writing rules :) can never find a good source of info
(thus pestering you instead).

I want to know howto write rules and rulsets that depends on if and similar.
I'm looking into the meta rules and such but it is hard to find a guide that
goes beyond the standard body, header and similar checks.

thx for the help! :D



Daniel McDonald-3 wrote:
>
>
>
>
> On 6/27/11 1:53 AM, "spixx_" <spixxrocks [at] gmail> wrote:
>
>>
>> Thank you! This what was I was looking for!
>>
>> rawbody
>
> Not certain why you are using rawbody. I might suggest you use subtests
> and
> tflags multiple:
>
>
> E.g:
>
> body __GREEN_LIAISON1
> /\b(?:proprietary|information|technology|renewables|alternative)\b/i
> describe __GREEN_LIAISON1 Remove the emails with green tech spies
> tflags __GREEN_LIAISON1 multiple
>
> body __GREEN_LIAISON2
> /\b(?:Positive|relationship|international|institutions)\b/i
> describe __GREEN_LIAISON2 Remove the emails with green tech spies
> tflags __GREEN_LIAISON2 multiple
>
>
> header __GREEN_LIAISON3 Subject =~
> /\b(?:Green|renewables|technology|liaison)\b/i
> describe __GREEN_LIAISON3 Checking the header for more of the same
> tflags __GREEN_LIAISON3 multiple
>
> meta GREEN_LIAISON __GREEN_LIAISON1 > 2 && __GREEN_LIAISON2 > 2 &&
> __GREEN_LIAISON3 > 1
> describe GREEN_LIAISON Contains a lot of words found in green tech scams
>
>> Not sure but I have to say that there is room for a good Howto on this
>> topic. I will try and push myself to learn more and then try and make one
>> for us dummies :)
>
> A howto on writing rules? Or on perl regular expressions in general? If
> you just want to understand perl regular expressions, there is no better
> place to start than perldoc perlretut
>
> --
> Daniel J McDonald, CCIE # 2495, CISSP # 78281
>
>
>
>

--
View this message in context: http://old.nabble.com/Stupid-questions-V-2.0-tp31909247p31937863.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


martin at gregorie

Jun 27, 2011, 8:06 AM

Post #8 of 8 (320 views)
Permalink
Re: Stupid questions V 2.0 [In reply to]

On Mon, 2011-06-27 at 08:49 -0500, Daniel McDonald wrote:
>
> body __GREEN_LIAISON1
> /\b(?:proprietary|information|technology|renewables|alternative)\b/i
> describe __GREEN_LIAISON1 Remove the emails with green tech spies
> tflags __GREEN_LIAISON1 multiple
>
> body __GREEN_LIAISON2
> /\b(?:Positive|relationship|international|institutions)\b/i
> describe __GREEN_LIAISON2 Remove the emails with green tech spies
> tflags __GREEN_LIAISON2 multiple
>
>
> header __GREEN_LIAISON3 Subject =~
> /\b(?:Green|renewables|technology|liaison)\b/i
> describe __GREEN_LIAISON3 Checking the header for more of the same
> tflags __GREEN_LIAISON3 multiple
>
> meta GREEN_LIAISON __GREEN_LIAISON1 > 2 && __GREEN_LIAISON2 > 2 &&
> __GREEN_LIAISON3 > 1
> describe GREEN_LIAISON Contains a lot of words found in green tech scams
>
There's another problem in this and the OP's rule set: Both
__GREEN_LIAISON1 and __GREEN_LIAISON3 will fire on the words
'renewables' and 'technology' in the subject line because the subject
text is prepended to the body text to form the input for a 'body' rule.
This is probably not what the OP wants.


Martin

SpamAssassin users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.