You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Bob Proulx <bo...@proulx.com> on 2014/02/20 23:56:03 UTC

-D turns off Bayes in in 3.4.0?

With the sa-update channel problems now behind us I have upgraded
again to 3.4.0 and am using it.  It appears now that using -D turns
off Bayes?

  spamassassin -d -t -D < mail.file | less

No BAYES_* anything is recorded.  Versus using:

  spamassassin -d -t < mail.file | less

Where BAYES_* scoring is seen.  Neither is it enabled even when
debugging "bayes" specifically.  Making that feature rather hard to
use now.  :-(

  spamassassin -d -t -D bayes < mail.file | less

It looks to me that -D now disables Bayes as a regression in 3.4.0.

Thanks,
Bob

Re: -D turns off Bayes in in 3.4.0?

Posted by Bob Proulx <bo...@proulx.com>.
Wolfgang Zeikat wrote:
> Bob Proulx wrote:
> > spamassassin -d -t -D < mail.file | less
> 
> Note: in the above command you did _not_ redirect STDERR to STDOUT

Oops.  My bad.  I should have shown that.  I was concentrating on the
options and neglected the right hand side.

> >   spamassassin -d -t -D 2>&1 | grep -i bayes | tee /tmp/sa.bayes-debug.out
> 
> In this second command you _did_ redirect STDERR to STDOUT via
> "2>&1"

Yes.  I actually did in both cases.  I just didn't show it correctly
in my email.  The result for me is the same.

Normally I have a script 'sat' that I pipe messages in through from my
mailer.  But for the test I did it from the command line to have a
selfcontained test case.  But normally I have this script.

  #!/bin/sh
  # spamassassin -d -t -D bayes 2>&1 | less
  # spamassassin -d -t -D 2>&1 | less
  spamassassin -d -t 2>&1 | less

And as you can see I have all three combinations readily available.
In order to have the content summary available I have removed the -D
option entirely.  That works.  So this isn't urgent for me to figure
out.  But it is very odd.

> My experience has been that I need to redirect STDERR to STDOUT in
> order to catch the full output of
> spamassassin -D -t

Agreed.  Thank you for your careful reading of my email.  And I am
embarrassed that I did not present it correctly.

Bob

Re: -D turns off Bayes in in 3.4.0?

Posted by Wolfgang Zeikat <wo...@desy.de>.
In an older episode, on 2014-02-20 23:56, Bob Proulx wrote:
 > spamassassin -d -t -D < mail.file | less

Note: in the above command you did _not_ redirect STDERR to STDOUT

In an older episode, on 2014-02-21 19:20, Bob Proulx wrote:

> I picked a spam message and piped it into:
>
>    spamassassin -d -t -D 2>&1 | grep -i bayes | tee /tmp/sa.bayes-debug.out

In this second command you _did_ redirect STDERR to STDOUT via
"2>&1"

My experience has been that I need to redirect STDERR to STDOUT in order 
to catch the full output of
spamassassin -D -t

Hope this helps,

wolfgang


Re: -D turns off Bayes in in 3.4.0?

Posted by Bob Proulx <bo...@proulx.com>.
Kevin A. McGrail wrote:
> Bob Proulx wrote:
> >It looks to me that -D now disables Bayes as a regression in 3.4.0.
>
> Can't recreate and can't see how that's possible.  -D turns on debug
> output and I don't see any references to the config option in the
> Bayes library.  Not saying you are wrong but it sounds a bit
> unlikely.

I agree that the connection between those two things seems odd.  But I
am definitely seeing it.

> And here's a dummy devel system with bayes turned on with no tokens:

Hmm...  Thanks for trying to reproduce this.  It is useful because if
it isn't reproducible to you then it must be something particular
about my system that is causing this.  Knowing that is very useful.

> What does spamassassin -d -t -D < mail.file 2>&1 | grep -i bayes
> show for you?

I picked a spam message and piped it into:

  spamassassin -d -t -D 2>&1 | grep -i bayes | tee /tmp/sa.bayes-debug.out

It produced this output:

  Feb 21 11:09:22.480 [1714] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes from @INC
  Feb 21 11:09:22.670 [1714] dbg: config: fixed relative path: /var/lib/spamassassin/3.004000/updates_spamassassin_org/23_bayes.cf
  Feb 21 11:09:22.670 [1714] dbg: config: using "/var/lib/spamassassin/3.004000/updates_spamassassin_org/23_bayes.cf" for included file
  Feb 21 11:09:22.670 [1714] dbg: config: read file /var/lib/spamassassin/3.004000/updates_spamassassin_org/23_bayes.cf
  Feb 21 11:09:23.350 [1714] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x351ce78) implements 'learner_new', priority 0
  Feb 21 11:09:23.350 [1714] dbg: bayes: learner_new self=Mail::SpamAssassin::Plugin::Bayes=HASH(0x351ce78), bayes_store_module=Mail::SpamAssassin::BayesStore::DBM
  Feb 21 11:09:23.363 [1714] dbg: bayes: learner_new: got store=Mail::SpamAssassin::BayesStore::DBM=HASH(0x39bc410)
  Feb 21 11:09:23.363 [1714] dbg: plugin: Mail::SpamAssassin::Plugin::Bayes=HASH(0x351ce78) implements 'learner_is_scan_available', priority 0
  Feb 21 11:09:23.364 [1714] dbg: bayes: tie-ing to DB file R/O /home/bob/.spamassassin/bayes_toks
  Feb 21 11:09:23.364 [1714] dbg: bayes: tie-ing to DB file R/O /home/bob/.spamassassin/bayes_seen
  Feb 21 11:09:23.364 [1714] dbg: bayes: found bayes db version 3
  Feb 21 11:09:26.701 [1714] dbg: bayes: untie-ing

The content analysis part shows:

Content analysis details:   (11.8 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 1.9 URIBL_JP_SURBL         Contains an URL listed in the JP SURBL blocklist
                            [URIs: towns55.eu]
 1.7 URIBL_WS_SURBL         Contains an URL listed in the WS SURBL blocklist
                            [URIs: towns55.eu]
 1.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net
              [Blocked - see <http://www.spamcop.net/bl.shtml?67.222.157.193>]
 2.7 RCVD_IN_PSBL           RBL: Received via a relay in PSBL
                            [67.222.157.193 listed in psbl.surriel.com]
 0.1 UNKNOWN_RCVD           Unknown host in received header
 0.0 T_HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail
                            domains are different
 1.1 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts
 1.7 URIBL_BLACK            Contains an URL listed in the URIBL blacklist
                            [URIs: towns55.eu]
 1.3 RDNS_NONE              Delivered to internal network by a host with no rDNS
 0.0 T_REMOTE_IMAGE         Message contains an external image

Note that there are no BAYES_* rules shown.  And the points are
reduced by that amount.  If I run the same command removing only the
-D option from it then I get this content analysis.

  spamassassin -d -t 2>&1 | tee /tmp/sa.bayes-debug.out

Content analysis details:   (13.9 points, 5.0 required)

 pts rule name              description
---- ---------------------- --------------------------------------------------
 1.3 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net
              [Blocked - see <http://www.spamcop.net/bl.shtml?67.222.157.193>]
 2.7 RCVD_IN_PSBL           RBL: Received via a relay in PSBL
                            [67.222.157.193 listed in psbl.surriel.com]
 3.5 BAYES_99               BODY: Bayes spam probability is 99 to 100%
                            [score: 1.0000]
 0.1 UNKNOWN_RCVD           Unknown host in received header
 0.0 T_HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail
                            domains are different
 0.2 BAYES_999              BODY: Bayes spam probability is 99.9 to 100%
                            [score: 1.0000]
 0.7 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts
 1.7 URIBL_BLACK            Contains an URL listed in the URIBL blacklist
                            [URIs: towns55.eu]
 1.2 URIBL_JP_SURBL         Contains an URL listed in the JP SURBL blocklist
                            [URIs: towns55.eu]
 1.6 URIBL_WS_SURBL         Contains an URL listed in the WS SURBL blocklist
                            [URIs: towns55.eu]
 0.8 RDNS_NONE              Delivered to internal network by a host with no rDNS
 0.0 T_REMOTE_IMAGE         Message contains an external image

Note that without -D it shows both BAYES_99 and BAYES_999 and the
points are appropriate.  These were run back-to-back only a minute
apart from each other.

However if you can't recreate then it then must be something specific
to my system.  That is useful to me to know.  It tells me that I must
chase it down.  I will try a pristine system and clean installation
and see if that is different.  Hopefully so and then I can A-B compare
until I find the local problem.

Thanks,
Bob

Re: -D turns off Bayes in in 3.4.0?

Posted by "Kevin A. McGrail" <KM...@PCCC.com>.
On 2/20/2014 5:56 PM, Bob Proulx wrote:
> With the sa-update channel problems now behind us I have upgraded
> again to 3.4.0 and am using it.  It appears now that using -D turns
> off Bayes?
>
>    spamassassin -d -t -D < mail.file | less
>
> No BAYES_* anything is recorded.  Versus using:
>
>    spamassassin -d -t < mail.file | less
>
> Where BAYES_* scoring is seen.  Neither is it enabled even when
> debugging "bayes" specifically.  Making that feature rather hard to
> use now.  :-(
>
>    spamassassin -d -t -D bayes < mail.file | less
>
> It looks to me that -D now disables Bayes as a regression in 3.4.0.
>
> Thanks,
> Bob
Can't recreate and can't see how that's possible.  -D turns on debug 
output and I don't see any references to the config option in the Bayes 
library.  Not saying you are wrong but it sounds a bit unlikely.

And here's a dummy devel system with bayes turned on with no tokens:

spamassassin -d -t -D < /tmp/1.mbox 2>&1 | grep -i bayes
Feb 20 18:00:55.153 [19142] dbg: plugin: loading 
Mail::SpamAssassin::Plugin::Bayes from @INC
Feb 20 18:00:55.437 [19142] dbg: config: fixed relative path: 
/var/lib/spamassassin/3.004000/updates_spamassassin_org/23_bayes.cf
Feb 20 18:00:55.437 [19142] dbg: config: using 
"/var/lib/spamassassin/3.004000/updates_spamassassin_org/23_bayes.cf" 
for included file
Feb 20 18:00:55.437 [19142] dbg: config: read file 
/var/lib/spamassassin/3.004000/updates_spamassassin_org/23_bayes.cf
Feb 20 18:00:56.872 [19142] dbg: plugin: 
Mail::SpamAssassin::Plugin::Bayes=HASH(0x901ca5c) implements 
'learner_new', priority 0
Feb 20 18:00:56.873 [19142] dbg: bayes: learner_new 
self=Mail::SpamAssassin::Plugin::Bayes=HASH(0x901ca5c), 
bayes_store_module=Mail::SpamAssassin::BayesStore::DBM
Feb 20 18:00:56.889 [19142] dbg: bayes: learner_new: got 
store=Mail::SpamAssassin::BayesStore::DBM=HASH(0x9286940)
Feb 20 18:00:56.889 [19142] dbg: plugin: 
Mail::SpamAssassin::Plugin::Bayes=HASH(0x901ca5c) implements 
'learner_is_scan_available', priority 0
Feb 20 18:00:56.890 [19142] dbg: bayes: tie-ing to DB file R/O 
/root/.spamassassin/bayes_toks
Feb 20 18:00:56.891 [19142] dbg: bayes: tie-ing to DB file R/O 
/root/.spamassassin/bayes_seen
Feb 20 18:00:56.891 [19142] dbg: bayes: found bayes db version 3
Feb 20 18:00:56.892 [19142] dbg: bayes: DB journal sync: last sync: 0
Feb 20 18:00:56.892 [19142] dbg: bayes: not available for scanning, only 
3 spam(s) in bayes DB < 200
Feb 20 18:00:56.892 [19142] dbg: bayes: untie-ing
Feb 20 18:00:56.900 [19142] dbg: bayes: tie-ing to DB file R/O 
/root/.spamassassin/bayes_toks
Feb 20 18:00:56.900 [19142] dbg: bayes: tie-ing to DB file R/O 
/root/.spamassassin/bayes_seen
Feb 20 18:00:56.900 [19142] dbg: bayes: found bayes db version 3
Feb 20 18:00:56.901 [19142] dbg: bayes: DB journal sync: last sync: 0
Feb 20 18:00:56.901 [19142] dbg: bayes: not available for scanning, only 
3 spam(s) in bayes DB < 200
Feb 20 18:00:56.901 [19142] dbg: bayes: untie-ing
Feb 20 18:01:08.109 [19142] info: rules: meta test LOC_SHORT has 
dependency 'BAYES_00' with a zero score

What does spamassassin -d -t -D < mail.file 2>&1 | grep -i bayes show 
for you?

Regards,
KAM