On Mon, 2013-09-16 at 00:59 +0100, RW wrote: > On Sun, 15 Sep 2013 11:19:12 -0400 Harry Putnam wrote:
The real reason for what you're observing here is (as RW pointed out in a follow-up post), that SPF_SOFTFAIL has a score of 0.972 -- that, and you looking at the rounded scores in the brief summary, rather than the actual rules' scores. > > SA is letting mail thru as ham that should be spam apparently based on > > what is too low a score (for my mail) for URIBL_JP_SURBL which was > > 1.9 by default. > > > > I pushed it up to 4. > > > > But then I see a report that shows a total score of 4.9 when > > 4.0 is shown for URIBL_JP_SURBL > > 1.0 is shown for SPF_SOFTFAIL > > > > But the total score is 4.9. 4.972, to be precise. Less than 5.0, thus not spam. This is an edge case, where correct rounding would result in the headers essentially claiming "5.0 < 5.0". Since this is the threshold that matters most to people, correct rounding would lead to much more confusion and an FAQ. > > I assumed it had something to do with rounding or something so I > > increased the score to 4.1 to get that message to break the spam level > > of 5. > > > > Now the same mail shows a total of 5.1 5.072, rounding to 5.1 with a precision of 1 decimal place. > > So what happened..? in one case a point (.1) is dropped and in the > > other it is not. > > It's odd that 2 people should notice this almost simultaneouly when it's > been around for years (see "Score = 4.9" ) > > I had a look into it, and it seems that rounding is handled in an > unusual way. It starts by rounding to the nearest 0.1, and then > subtracts 0.1 if the result is non-spam to avoid the case of: I prefer the term special case, rather than "handling rounding in an unusual way", because in this one special case, SA simply does not round. > X-Spam-Status: No, score=5.0 required=5.0 > > IMO simply rounding towards zero using int would be better. I think most > people understand rounding, this is a lot more disconcerting. Most people do indeed understand rounding. They tend to forget about this when dealing with the all-magic decision they care about -- spam or not spam. Example? This very thread. Given that Harry customizes scores, he seems to have some experience with SA config, rules and scores. He checks the Result header of his low scorers, so "oddities" like -0.0 are most likely not new to him. I assume he knows about all that. Yet, being confronted with the initial mystery of 4.9 vs 5.0 and a sneaky spam refusing to cross that all-magic threshold, he seems to have forgotten about rounding. > None of this affects the result though, it's just what's displayed in > the headers. Very true. -- 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; }}}