stdout

David Relson relson at osagesoftware.com
Tue Sep 23 21:55:01 CEST 2003


On 23 Sep 2003 15:41:19 -0400
Tom Anderson <tanderso at oac-design.com> wrote:

> Hi all,
> 
> I'm writing a Perl script to proxy my train-on-error requests via
> email, and I've run into a slight wall.  Everything is working
> correctly, except I can't capture the output from my "bogofilter -Sn
> (or -Ns)" system calls.  I've tried all kinds of piping and
> redirecting, backticks, exec, etc., and bogofilter continues to send
> it's -v output to the terminal (when testing on the terminal).  Is it
> bypassing stdout?  Is there a way to capture -l output as well?  All I
> want to do is return some sort of status via email besides that it
> exited correctly.
> 
> Also, can a string be passed into bogofilter instead of a file?  I
> tried piping echo, but that caused "extra info" errors.  Creating a
> temp file to give bogofilter seems to be an unnecessary extra step.
> 
> Tom

Tom,

Take a look at tuning/bogotune or at contrib/bogotrain.pl to see
successful use of bogofilter from perl.

Strings can definitely be passed to bogofilter:

[relson at osage src]$ echo this is a test | bogofilter -vvv -d
/var/lib/bogofilter
X-Bogosity: No, tests=bogofilter, spamicity=0.415000, version=0.15.4
                                     n    pgood     pbad      fw     U
"head:test"                          0  0.000000  0.000000  0.415000 -
"head:this"                          0  0.000000  0.000000  0.415000 -
N_P_Q_S_s_x_md                       0  0.00e+00  0.00e+00  4.15e-01
                                        1.00e-02  4.15e-01  0.100

Bogofilter's output is generally to stdout.  stderr is used for error
and debug messages.  Command line flag "-D" can be used to direct the
messages to stdout.

David




More information about the Bogofilter mailing list