McDonald, Dan wrote:
On Sat, 2008-06-28 at 01:40 +0200, mouss wrote:
mouss wrote:
Is there some way to grab the metadata from IPCountry to count the
number of countries that were involved in sending a mail, and set a
score based on that?
you mean catching the "Junkman traveller"?

you can try

header THREE_COUNTRIES X-Relay-Countries =~ /\s[a-z]{2}\s/
score THREE_COUNTRIES 0.01

header FOUR_COUNTRIES X-Relay-Countries =~ /\s[a-z]{2}\s[a-z]{2}\s/
score FOUR_COUNTRIES 0.01

argh. This is wrong as it will hit things like "US US FR FR"...
and so on...

Correct.  And Spamassassin rules developers generally frown on using
back-tracking, as it slows down the whole ruleset even if only used for
one rule....

Seems like I would need to write a plugin to count this then, something
like this metacode...

my %countries
foreach my $relay (split(/\s/,$vauleofx\-relay\-countries)) {
        $countries{$relay}++;
};
return #$countries

it would be good to have two other meta-headers (in addition to X-Relay-Countries):
X-Relay-Country-Count: the total number of different countries
X-Relay-Country-Cross: the numbre of country "switches"

so "FR US FR US" would yield 2 countries but 3 switches, which should be less "normal" than "FR FR US US".


Reply via email to