Thanks for the explanation. I feared as much. Not possible for me to modify hmail (not a C++ programmer). I could look at SA code and how to compile but would be a significant learning curve which I don't have time for right now. I'll just have to live with it for the time being.
Thanks again. At 2014-07-26 21:59 +0200, Karsten Bräckelmann wrote: >On Sat, 2014-07-26 at 13:54 +0100, [email protected] wrote: >> running SA 3.4.0 binary as supplied by Jam software on windows 7 from >> hMailserver using SRVANY.EXE Service wrapper aaround spamd.exe >> >> >> All is running fine but I would like to be able to multiply the >> accumulated/total _SCORE_ by 10 before it is returned to hMailserver >> so that I don't lose any decimal places and am always working with >> integer values in hMailserver. >> >> I have customised report in my local.cf and currently output >> >> add_header spam Score _SCORE_ >> >> I would like to be able to multiply _SCORE_ by 10 > >This could be implemented by a custom plugin that provides a Template >Tag with the score multiplied. > >It is not possible to simply multiply the score. This would require code >changes to the core. > >> [...] and also the return value which is sent back via spamd multiplied >> by 10 > >You're confusing spamd with something else here. spamd is a daemon, >there is no return value as such. > >To be precise, there are two different methods: > >* The CHECK (or SYMBOLS, or REPORT) protocol command, which does not > return the changed message, but a brief response including the score. > >* The PROCESS protocol command, which returns the altered message. There > is no score returned here, other than what has been add_header'd. > >Since the CHECK command does return the score as value, this might match >what you asked for. However, unlike the PROCESS command, it does not >return the altered message. Thus there are no X-Spam headers added, >which you obviously use. > >So you are using the PROCESS command (default) and the returned "value" >of spamd is the full, altered message with SA headers added. > > >> is this possible and if so where/how would I apply the multiplication. > >See above, this requires a custom plugin or code changes. > >There are other possibilities, though. The most obvious one is, to teach >your glue (hMailserver?) to handle float values. > >Another option is to use a helper script to process the Score header. >The desired value of score*10 is the header's value with the single dot >dropped. (The score always includes exactly one decimal place.) > > >-- >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; }}}
