On Wed, 2009-08-05 at 12:11 +0200, Tomasz Chmielewski wrote: > Is it possible to count recipients with Spamassassin? > > Some of the spam I receive has multiple recipients in To: and/or CC: > headers, i.e.: > > To: 1...@example.com, 2...@example.com, 3...@example.com > CC: 1...@example.com, 2...@example.com, 3...@example.com > > > I would like to count the number of recipients and assign score accordingly. > > For example, when there are 5-10 recipients, assign 1 point; 11 > recipients and more - assign 2 points. > > Is it possible with Spamassassin? > > Here's the rule(s) I use. They were posted here on the list quite awhile back:
describe TO_TOO_MANY To: too many recipients header TO_TOO_MANY To =~ /(?:,[^,]{1,80}){20}/ score TO_TOO_MANY 0.3 describe TO_WAY_TOO_MANY To: way too many recipients header TO_WAY_TOO_MANY To =~ /(?:,[^,]{1,80}){20}/ score TO_WAY_TOO_MANY 0.3 describe CC_TOO_MANY CC: too many recipients header CC_TOO_MANY CC =~ /(?:,[^,]{1,80}){15}/ score CC_TOO_MANY 0.3 IIRC you can change the parameters in the 2nd set of {} to whatever number you decide, ie.. {20} to {10} or whatever. -- KeyID 0xE372A7DA98E6705C
signature.asc
Description: This is a digitally signed message part