On Mon, 2010-06-14 at 07:41 -0700, Daniel Lemke wrote: > I want to check some mails for their char count (will be part of a meta > rule) but spamassassin does hit the rule, even if the mail has less chars > than defined in regex.
You mean *more* chars, no? Less than zero isn't possible, and the RE allows any number of chars up to 150. Less is explicitly allowed. > The regex was tested in Perl and was working fine, so what did I miss? I'd run a test message through spamassassin -D and watch out for the rule hit. The debug output includes the match against the RE. > body MY_BODY_SHORT_MAIL /\A.{0,150}\z/s > describe MY_BODY_SHORT_MAIL Short Mail > score MY_BODY_SHORT_MAIL 0.1 -- char *t="\10pse\0r\0dtu...@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4"; main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1: (c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}