bogofilter's exit codes

David Relson relson at osagesoftware.com
Mon Jul 28 21:04:03 CEST 2003


At 02:50 PM 7/28/03, Gyepi SAM wrote:
>On Mon, Jul 28, 2003 at 10:05:07AM -0700, Malcolm Dew-Jones wrote:
>
> > I would suggest that the error code return the calculated
> > probability as a percent (i.e. 0-100), and errors return a much
> > higher value, (e.g. 200 and above).  That way scripts can examine the
> > probability and use it any way they wish.
>
> > We patch bogofilter to do this, Our patch is just a hack that ...
>
>I am definitely opposed to introducing this into the main code.
>
>It flouts the long accepted semantics of exit codes for an experimental 
>feature.
>
>I would invoke bogofilter with the -v switch and parse the 'X-Bogosity:' 
>header with a sed or perl scriptlet.
>
>-Gyepi

I think it's a bit much having 101 return codes to reflect the score

Parsing the "-v" output would work.  Even simpler is the output of terse 
mode, i.e. "-vt", which defaults to

N 0.000000
Y 1.000000

There's a config file option named "terse_format" that allows changing the 
format of the above lines.  The format above (which is "%1.1c %f") could be 
changed to "%4.2f" so values would print as 0.00, 0.93, etc.






More information about the bogofilter-dev mailing list