cgi script doesn't import bogofilter output

David Relson relson at osagesoftware.com
Fri Jan 23 02:50:42 CET 2004


On Thu, 22 Jan 2004 16:58:52 -0800
Chris Fortune wrote:

> 
> This is probably a *nix permissions question, but maybe not, since
> bogofilter is the only program that gives me this problem.  I have a
> perl script that calls bogofilter in this way:
> 
>         $res = `bogofilter -T < $filename`;
>         $exitcode = $? >> 8;
> 
> It works well from the command line, spitting out the expected Terse
> output (eg: "H 0.00804545"), and exitcode 0 or 1.  But, when I run it
> from the web (a cgi demo for my partner), $res is empty and exitcode
> is always 139.
> 
> Thanks

Hi Chris,

Sounds like you're trying something interesting :-)

139 seems familiar (from years back).  Unfortunately I can't pin down
the memory.

It might help is to create a shell script wrapper, say bogofilter.sh,
and use it to save more information.  You need to generate a bunch of
information so you can see how the command line and cgi environments
differ.  It sounds like there's a difference that's causing bogofilter
to fail.  

As you suggest the problem could be  *nix permissions.  It could be an
environment variable that's missing or set badly.  Possibility is that
bogofilter can't find wordlist.db.  Where is it and how are you
communicating that info to bogofilter?  

Adding flags "-x d -vv" to the bogofilter invocation will display some
datastore related debugging info.  File src/debug.h has a list of debug
flags that can be used with "-x".  Experiment with them and with running
the wrapper script from the command line and via cgi.  Have different
output files for the two types of invocation and compare them.

Let us know what you learn.

David




More information about the Bogofilter mailing list