You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Phibee Network Operation Center <no...@phibee.net> on 2008/03/25 09:22:00 UTC

Exact Synthax for "To:" scoring ?

Hi

i am search the exact synthaxe for say :

header SPEC_DOMAIN          To =~ /*@specific-domain.com/
describe SPEC_DOMAIN       Reduc score for domain specific-domain.com
score SPEC_DOMAIN           -1.3

Apply only one tine -1.3 at all emails that have in To:, Cc: or Bcc: 
destination
to a specific domain.

Anyone can help me to write correcly the rules ?
can i specify that for -1.3 are for a specifi-domain AND for scoring < 8 ?

Thanks for your help
Jpc


Re: Exact Synthax for "To:" scoring ?

Posted by Matt Kettler <mk...@verizon.net>.
Phibee Network Operation Center wrote:
> Hi
>
> i am search the exact synthaxe for say :
>
> header SPEC_DOMAIN          To =~ /*@specific-domain.com/
> describe SPEC_DOMAIN       Reduc score for domain specific-domain.com
> score SPEC_DOMAIN           -1.3
>
> Apply only one tine -1.3 at all emails that have in To:, Cc: or Bcc: 
> destination
> to a specific domain.
>
> Anyone can help me to write correcly the rules ?
> can i specify that for -1.3 are for a specifi-domain AND for scoring < 
> 8 ?
Well, first, it will not work for BCC mail, unless your MTA inserts 
hints into the Received: header about the actual recipient. There is no 
such thing as a Bcc: header in email. Bcc's are handled by having the 
recipient only in the SMTP envelope, and SpamAssassin does not have 
access to the envelope, only your MTA does. If it's not in the message 
(with complete headers) then SA doesn't know about it.

Also, rules can't be aware of the current message score, so you can't 
use your scoring < 8 criteria.

Your rule itself won't work as-is because of a couple mistakes.

In regular expressions, * isn't a wildcard. It's a repeat count. If you 
want to match any number of any character, you need to use .*  the . is 
a single character wildcard, and * expands it to be any number of wildcards.

You don't need leading or trailing wildcards anyway. Regexes will match 
substrings, so you don't need to match the entire string.

You also need to escape the @ sign, and I'd suggest escaping the . 
because by default both have special meanings (although . is a wildcard, 
so it is semi-harmless. However it will match things like 
specific-domain-com when you really want a dot there).

A fixed rule would be:

header SPEC_DOMAIN          To =~ /\@specific-domain\.com/
describe SPEC_DOMAIN       Reduce score for domain specific-domain.com
score SPEC_DOMAIN           -1.3


>
> Thanks for your help 

np.