On Sat, 2010-10-09 at 11:35 -0400, Dennis German wrote: > The question is: Has anyone seen unpredictable and different results > when processing the same message?
No. > The operative part of the script is: > > #first run use > echo setting aside user_prefs, running with system wide values > mv ~/.spamassassin/user_prefs ~/.spamassassin/user_prefss > cp ~/.spamassassin/user_prefs.rptonly ~/.spamassassin/user_prefs > grep -iv X-SPAM $1 | spamc > $1.o > grep X-Spam $1.o Your grepping is broken. You're not limiting the pattern at the beginning of a line, and more importantly don't account for multi-line headers. This can result in a lot of strange things. Formail is your friend. To correctly extract all X-Spam headers, use formail -X, and to remove them use -I instead of -X. formail -X X-Spam < $msg However, there is no need to remove SA headers before processing it a second time with SA. SA ignores these. > grep -A14 "pts rule name" $1.oo|grep -v "\-\-\-\-" What if there are more lines?? > I run the script multiple times and get unpredictable results regarding > the appearance of MISSING_MID. Yeah, I can see that happening with a script like the above. :) -- 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; }}}