On Mon, 2013-10-21 at 14:11 +0200, Tom Hendrikx wrote: > I have been using __MANY_RECIPS in some meta rules for some time now, > and noticed a weird FP today. The rule seems to count the number of '@'s > in the To and CC header. Someone sent a mail to using the (albeit silly) > format, probably by using reply-to-all in a braindead MUA: > > To "The foo mailing list" <f...@lists.domain.tld> > CC: "f...@lists.domain.tld" <f...@lists.domain.tld> > > This triggers the __MANY_RECIPS rule as the @ occurs (at least?) 3 times. > > Is there any alternative to this rule, that only lists the addresses > (i.e. excludes the name part in the To/CC)?
Nothing even remotely correct and sufficiently simple to squeeze into a RE. Counting the @ chars is pretty rough, but a suitable trade-off IMHO. I'd argue that 3 is too low to count as "many". (Regardless of the implementation and the FP you encountered.) > Or maybe even removes the duplicates (that would probably be an eval > rule)? Yep, that would require an eval rule. As would any more sophisticate implementation of the original rule. -- char *t="\10pse\0r\0dtu\0.@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; }}}