You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Ben Wylie <sa...@benwylie.co.uk> on 2005/03/14 01:39:40 UTC

save debug output and errors

Hello All,

This is the first time I have used this list so if should have done it a
different way, or have said something wrong, I beg your forgiveness.

I have been running spamassassin for over a year now on my Windows 2003
system using perl 5.6.1. My SA version is 3.0.2.
I run Spamassassin from a batch file:

cd F:\perl\bin
set tmpfile=%1.tmp
f:\perl\bin\perl.exe spamassassin < %1 > %tmpfile%
move /Y %tmpfile% %1

Where %1 is the path to the email file.

I have been having problems with SA for a while, where it is running, but
clearly not functioning correctly, as the BAYES tests are not completing and
various other tests are not either.

Today I decided to try testing it by manually testing some files with the
debug option enabled.

My first question is about saving this debug info. Running this from the
command prompt means that the debug info goes past rapidly, and I lose most
of it as it scrolls off the top of the display. Is there an option to save
debug info to a file which I can look through in my own time?

>From the parts of the debug that I have been able to look at, there are
various errors which I have been unable to work out a solution to, mainly
because I don't understand what they mean.

1) Argument "BODY" isn't numeric in addition (+) at
F:\Perl\site\lib/Mail/SpamAssassin/Conf.pm line 244.

2) debug: URIDNSBL: queries completed: 2 started: 0
debug: URIDNSBL: queries active:  at Sun Mar 13 14:19:17 2005
debug: done waiting for URIDNSBL lookups to complete
debug: running meta tests; score so far=14.882
Scalar found where operator expected at (eval 57) line 724, near "} $self"
        (Missing operator before  $self?)
Failed to run meta SpamAssassin tests, skipping some: syntax error at (eval
57)
line 724, near "} $self"

This second error stops SA from doing any more tests and it just scores the
email on the tests it has already done.

What is also confusing, is that different tests get done when I run the test
by hand, and by my mail server, using exactly the same batch file. For
example, the BAYES test is no longer done when run by my mailserver, but
when done by hand it is.

Eg.
By Mailserver:
X-Spam-Report: 
	*  0.1 FORGED_RCVD_HELO Received: contains a forged HELO
	*  0.5 INFO_TLD URI: Contains an URL in the INFO top-level domain
	*  1.6 NUMERIC_HTTP_ADDR URI: Uses a numeric IP address in URL
	*  1.3 HTML_IMAGE_ONLY_16 BODY: HTML: images with 1200-1600 bytes of
words
	*  0.0 HTML_60_70 BODY: Message is 60% to 70% HTML
	*  2.7 URIBL_SBL Contains an URL listed in the SBL blocklist
	*      [URIs: dhashsad.info]

By Hand, but with the same batch file:
X-Spam-Report: 
	*  2.1 NUMERIC_HTTP_ADDR URI: Uses a numeric IP address in URL
	*  5.0 BAYES_99 BODY: Bayesian spam probability is 99 to 100%
	*      [score: 0.9976]
	*  1.0 HTML_IMAGE_ONLY_16 BODY: HTML: images with 1200-1600 bytes of
words
	*  2.7 URIBL_SBL Contains an URL listed in the SBL blocklist
	*      [URIs: dhashsad.info]
	*  4.0 URIBL_OB_SURBL Contains an URL listed in the OB SURBL
blocklist
	*      [URIs: dhashsad.info]

Help in any or all of these matters, very much appreciated. If you think
there is a document which I have not read well enough which might contain
useful info, please do give me a link so I can look it up.

Thanks,
Ben




Re: save debug output and errors

Posted by Theo Van Dinter <fe...@kluge.net>.
On Mon, Mar 14, 2005 at 05:03:05AM -0000, Ben Wylie wrote:
> Scalar found where operator expected at (eval 57) line 724, near "} $self"
>         (Missing operator before  $self?)
> Failed to run meta SpamAssassin tests, skipping some: syntax error at (eval
> 57)
> line 724, near "} $self"
> 
> where should I look for this to fix?

Looks like you still have a bad meta rule somewhere...

-- 
Randomly Generated Tagline:
 Bender: This is the Brooklyn-bound B train making local stops at wherever 
  the hell I feel like, watch for the closing doors.

RE: save debug output and errors

Posted by Ben Wylie <sa...@benwylie.co.uk>.
-----Original Message-----
From: Ben Wylie [mailto:sassassin@benwylie.co.uk] 
Sent: 14 March 2005 13:28
To: users@spamassassin.apache.org
Subject: RE: save debug output and errors
>
> Having managed to capture the errors which pop up when my mailserver runs
> the spamassassin batch script, it is coming up with two errors:
>
> Argument "BODY" isn't numeric in addition (+) at
> F:\Perl\site\lib/Mail/SpamAssassin/Conf.pm line 244.
>
> bayes: bayes db version 2 is not able to be used, aborting! at
> F:\Perl\site\lib/Mail/SpamAssassin/BayesStore/DBM.pm line 160.
>
> When I run the exact same batch script by hand, I only get the first
> error, and the bayes function works.
>
> Does this "bayes db version 2 is not able to be used" error mean something
> specific or is it just a general bayes error?

Following up on my own post.
I have discovered it is because my Mailserver is running as user SYSTEM. It
therefore also runs SA as SYSTEM, and looks for the bayes database in:
F:\Documents and Settings\NetworkService/.spamassassin/

Using the bayes_path option, I have now got it looking in the correct folder
and all is well.
Thanks for the help with getting the debug info.

Ben





RE: save debug output and errors

Posted by Ben Wylie <sa...@benwylie.co.uk>.
> > where should I look for this to fix?
>
> Theo has the answer for that one - a bad meta rule somewhere.
>
> Given that --lint seemingly didn't catch it, and this pure perl error is
> less than descriptive of the problem, once you find the rule in question,
> I think it deserves a Bugzilla entry for failure to check sufficiently for
> bad meta rules in lint.  You will need to supply the bad meta rule in 
> question, and possibly the rules it depends on.
>
> If you don't have a Bugzilla account I'll enter it for you.

Thanks again for your help.
I found that the error was in a ruleset I took from:
http://www.rulesemporium.com/rules/70_sare_oem.cf

However I was a bit stupid and overwrote the initial set with a fresh one
from that link, and the error has gone away. So I'm afraid I have lost the
file which had the error, so am not in a position to find the problematic
rule. Sorry about that.

Having managed to capture the errors which pop up when my mailserver runs
the spamassassin batch script, it is coming up with two errors:

Argument "BODY" isn't numeric in addition (+) at
F:\Perl\site\lib/Mail/SpamAssassin/Conf.pm line 244.

bayes: bayes db version 2 is not able to be used, aborting! at
F:\Perl\site\lib/Mail/SpamAssassin/BayesStore/DBM.pm line 160.

When I run the exact same batch script by hand, I only get the first error,
and the bayes function works.

Does this "bayes db version 2 is not able to be used" error mean something
specific or is it just a general bayes error?

Thanks
Ben




Re: save debug output and errors

Posted by Loren Wilton <lw...@earthlink.net>.
> where should I look for this to fix?

Theo has the answer for that one - a bad meta rule somewhere.

Given that --lint seemingly didn't catch it, and this pure perl error is
less than descriptive of the problem, once you find the rule in question, I
think it deserves a Bugzilla entry for failure to check sufficiently for bad
meta rules in lint.  You will need to supply the bad meta rule in question,
and possibly the rules it depends on.

If you don't have a Bugzilla account I'll enter it for you.

        Loren


RE: save debug output and errors

Posted by Ben Wylie <sa...@benwylie.co.uk>.
-----Original Message-----
> From: Loren Wilton [mailto:lwilton@earthlink.net] 
> Sent: 14 March 2005 02:36
> To: users@spamassassin.apache.org
> Subject: Re: save debug output and errors
>
> You probably have some broken rules or other lines in your local rules 
> file, or possibly elsewhere in the rules files.  To catch thos you want to
> run "spamassassin --lint" without the debug stuff.  This will give you a
> managable output.
Thanks for the help.
It pointed out some bad rules and other odd stuff, but there is one I don't
understand:

F:\Perl\bin>spamassassin <sample-spam2.txt >log6.txt
Scalar found where operator expected at (eval 57) line 724, near "} $self"
        (Missing operator before  $self?)
Failed to run meta SpamAssassin tests, skipping some: syntax error at (eval
57)
line 724, near "} $self"

where should I look for this to fix?

Thanks,
Ben




Re: save debug output and errors

Posted by Loren Wilton <lw...@earthlink.net>.
You probably have some broken rules or other lines in your local rules file,
or possibly elsewhere in the rules files.  To catch thos you want to run
"spamassassin --lint" without the debug stuff.  This will give you a
managable output.

Assuming you are on NT of some flavor, "spamassassin <stuff> 2>&1
>outfile.txt" should catch the stderror output as well as the stdout output.
"<stuff>" is obviously whatever parameters you want to give, like "-D
<myspam.txt" or the like.

        Loren