You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Scott <te...@msxc.com> on 2017/08/11 21:22:28 UTC

Re: Bayes auto-learn - Solved

Restored my last copy of my manually learned bayes database from the "bad"
directory to the new location.  Let it cook for a day.  Of the messages that 
made it through postscreen, RBLs, etc since my logs rotated early this
morning, 93% were autolearn=no,  2% autolearn=spam, 5% autolearn=ham.  ZERO
autolearn=unavailable.

This is solved.  

Summary for posterity for anyone who may run into the same problem.  Some
tags for searching:

Centos7 (selinux disabled at the time of testing)
Postfix 3.2.2
Amavisd-new amavisd amavis 2.11.0
Spamassassin 3.4.0 
bayes
autolearn=unavailable

I strongly suspected bayes auto-learn was not functioning.  Read the thread
for evidence.  In local.cf had the bayes path set to:
/etc/mail/bayes/bayes

Don't remember if it came packaged that way or if I followed someone else's
"guide" to ed up with that bad location.  I do see one well written guide
that specified that folder, honestly I'm not sure. No matter.

In any case, the end result was that any message that would have been
autolearned got "autolearn=unavailable" and did not learn.

The fix for this setup as listed above was to NOT have the directory under
/etc.  Even with wide open (777) write permissions, amavisd/SA was
apparently unable to write there.  

I moved the bayes database under /var/spool/amavisd/bayes and all now
functions properly.  Note the default if no path is specified is
/var/spool/amavisd/.spamassassin/bayes IIRC (assuming /var/spool/amavisd is
the home directory for amavis)  I tested both, it appears happy with either.
local.cf:
bayes_path /var/spool/amavisd/bayes/bayes

I now have a journal file FWIW:
[root@mail2 root]# ls -la /var/spool/amavisd/bayes
total 4280
drwx------ 2 amavis amavis    4096 Aug 11 16:07 .
drwxr-xr-x 7 amavis amavis    4096 Aug 10 22:18 ..
-rw-rw-rw- 1 amavis amavis   81888 Aug 11 16:07 bayes_journal
-rw-rw-rw- 1 amavis amavis   86016 Aug 11 16:07 bayes_seen
-rw-rw-rw- 1 amavis amavis 5267456 Aug 11 16:07 bayes_toks

And my database is happy:
[root@mail2 root]# su amavis -c 'sa-learn --dump magic'
0.000          0          3          0  non-token data: bayes db version
0.000          0        359          0  non-token data: nspam
0.000          0        494          0  non-token data: nham
0.000          0     149970          0  non-token data: ntokens

I now know way more about amavis-new and spamassassin than I did when I
started.  Guess that's the silver lining to a few days of hair pulling.  

Thanks,
Scott













--
View this message in context: http://spamassassin.1065346.n5.nabble.com/Bayes-auto-learn-not-happening-tp138065p138314.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.

Re: Bayes auto-learn - Solved

Posted by John Hardin <jh...@impsec.org>.
On Fri, 11 Aug 2017, John Hardin wrote:

> On Fri, 11 Aug 2017, Scott wrote:
>
>>  I'm chicken.  :D
>>
>>  I don't have much (almost no) experience overriding those yum packages.
>
> It's pretty simple, just "yum install {local_filename}"
>
>>  And those warnings I got when I rebuilt from source made me nervous.
>
> I suppose I could publish the Centos 7 x86/64 RPMs I build and use on my 
> website. They wouldn't be signed...

   http://www.impsec.org/~jhardin/antispam/centos7/

You do need the epel-release package installed to use this.

-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   Je ne suis pas Charlie. Je suis armé.
-----------------------------------------------------------------------
  4 days until the 72nd anniversary of the end of World War II

Re: Bayes auto-learn - Solved

Posted by John Hardin <jh...@impsec.org>.
On Fri, 11 Aug 2017, Scott wrote:

> I'm chicken.  :D
>
> I don't have much (almost no) experience overriding those yum packages.

It's pretty simple, just "yum install {local_filename}"

> And those warnings I got when I rebuilt from source made me nervous.

I suppose I could publish the Centos 7 x86/64 RPMs I build and use on my 
website. They wouldn't be signed...


-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   USMC Rules of Gunfighting #6: If you can choose what to bring
   to a gunfight, bring a long gun and a friend with a long gun.
-----------------------------------------------------------------------
  4 days until the 72nd anniversary of the end of World War II

Re: Bayes auto-learn - Solved

Posted by Scott <te...@msxc.com>.
I'm chicken.  :D

I don't have much (almost no) experience overriding those yum packages.  And
those warnings I got when I rebuilt from source made me nervous.

Maybe when the dust settles...





--
View this message in context: http://spamassassin.1065346.n5.nabble.com/Bayes-auto-learn-not-happening-tp138065p138316.html
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.

Re: Bayes auto-learn - Solved

Posted by John Hardin <jh...@impsec.org>.
On Fri, 11 Aug 2017, Scott wrote:

> Centos7 (selinux disabled at the time of testing)
> Spamassassin 3.4.0

Next on your plate: upgrading to 3.4.1...

https://dl.fedoraproject.org/pub/fedora/linux/releases/25/Everything/source/tree/Packages/s/spamassassin-3.4.1-9.fc25.src.rpm

It works jes' fine here.

...ooo, time to update:
https://dl.fedoraproject.org/pub/fedora/linux/releases/26/Everything/source/tree/Packages/s/spamassassin-3.4.1-12.fc26.src.rpm


-- 
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  jhardin@impsec.org    FALaholic #11174     pgpk -a jhardin@impsec.org
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   ...for a nation to tax itself into prosperity is like
   a man standing in a bucket and trying to
   lift himself up by the handle.                 -- Winston Churchill
-----------------------------------------------------------------------
  4 days until the 72nd anniversary of the end of World War II