On Thu, 2010-11-04 at 15:55 -0230, Lawrence @ Rogers wrote:
> I've noticed a bunch of spams coming in recently that have no To: and
> Subject: and have cobbled together the following rule to combat them.
> Any feedback would be appreciated.
Just as a side note, there is a difference between a missing and an
empty header.
> # Message has empty To: and Subject: headers
> # Likely spam
> header __LW_EMPTY_SUBJECT Subject =~ /[[:space:]]$/
That rule does *not* do what you intend. It matches, if the last char of
the Subject happens to be a whitespace.
By definition, that header is not empty. Moreover, it is not equivalent
to a header that has no printable chars, which seems to be what you
actually tried the RE to match.
--
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; }}}