You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Raquel <ra...@thericehouse.net> on 2007/09/04 03:31:03 UTC

autolearn=failed

I'm setting up a new server.  However, email sent to the server
keeps getting "autolearn=failed".  I don't seem to be able to figure
out is causing that.

-- 
Raquel
============================================================
Those who make peaceful revolution impossible will make violent
revolution inevitable.
  --John F. Kennedy


Re: autolearn=failed

Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
Raquel wrote:
> I'm setting up a new server.  However, email sent to the server
> keeps getting "autolearn=failed".  I don't seem to be able to figure
> out is causing that.

Run a message that hasn't been learned through spamassassin manually as 
the user who you normally scan as (ie. 'spamassassin' per another post 
of yours) and check the debug output.

spamassassin -Dbayes < message-that-hasn't-been-learned


Daryl


Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Mon, 3 Sep 2007 18:44:35 -0700
Raquel <ra...@thericehouse.net> wrote:

> On Mon, 3 Sep 2007 18:39:40 -0700
> Raquel <ra...@thericehouse.net> wrote:
> 
> > On Mon, 3 Sep 2007 18:31:03 -0700
> > Raquel <ra...@thericehouse.net> wrote:
> > 
> > > I'm setting up a new server.  However, email sent to the
> > > server keeps getting "autolearn=failed".  I don't seem to be
> > > able to figure out is causing that.
> > > 
> > > -- 
> > > Raquel
> > > 
> > 
> > I should say that this server is Debian Etch w/spamassassin
> > version 3.1.7.
> > 
> > My local.cf says:
> >     bayes_auto_learn 1
> >     use_bayes_rules 1
> >     bayes_auto_learn_threshold_nonspam 0.1
> >     bayes_auto_learn_threshold_spam 10
> > 
> > -- 
> > Raquel
> > 
> 
> I should also say that spamassassin is being called by
> spamass-milter on sendmail and that it is a site-wide
> installation.
> 
> -- 
> Raquel
> 

Looking at my mail log, it seems I'm having several permissions
issues.  I'm going to be working on solving those and when I finish
I'll let everyone know the results.  Thanks for all the ideas.

-- 
Raquel
============================================================
Religion is all bunk.
  --Thomas Edison


Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Mon, 3 Sep 2007 18:39:40 -0700
Raquel <ra...@thericehouse.net> wrote:

> On Mon, 3 Sep 2007 18:31:03 -0700
> Raquel <ra...@thericehouse.net> wrote:
> 
> > I'm setting up a new server.  However, email sent to the server
> > keeps getting "autolearn=failed".  I don't seem to be able to
> > figure out is causing that.
> > 
> > -- 
> > Raquel
> > 
> 
> I should say that this server is Debian Etch w/spamassassin
> version 3.1.7.
> 
> My local.cf says:
>     bayes_auto_learn 1
>     use_bayes_rules 1
>     bayes_auto_learn_threshold_nonspam 0.1
>     bayes_auto_learn_threshold_spam 10
> 
> -- 
> Raquel
> 

I should also say that spamassassin is being called by
spamass-milter on sendmail and that it is a site-wide installation.

-- 
Raquel
============================================================
What is hateful you do not do to your neighbor: that is the whole
Torah.
  --Shammai


[SOLVED] Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Wed, 5 Sep 2007 01:22:15 -0500 (CDT)
Dave Funk <db...@engineering.uiowa.edu> wrote:

> On Tue, 4 Sep 2007, Raquel wrote:
> 
> >>
> > bayes_path /usr/spamassassin/bayes
> > bayes_file_mode 0777
> 
> OK, is the directory "/usr/spamassassin" writable by the user-ID
> that you are running spamd as? What happens if you do a:
>     chmod 1777 /usr/spamassassin
> 
> and then retest?
> 
> Strong suggestion, do -not- put your bayes stuff into a directory
> that contains other SA components. Best to have a directory in
> your "/var" partition just for the bayes stuff.
> 
> 
> -- 
> Dave Funk

I changed this to:
    #chmod -R 1777 /usr/spamassassin
and it appears to be working now, although I shall be trying to send
mail to other users.

Thank you for setting me in the right direction.

I am wondering though why the previous permissions works on my other
server (Debian Sarge, Sendmail, SpamAssassin 3.0.3, and firing from
procmail)  Is it because calling SA from procmail I used
"DROPPRIVS=yes"?

-- 
Raquel
============================================================
I hope we shall take warning from the example [of England] and crush
in it's [sic] birth the aristocracy of our monied corporations which
dare already to challenge our government to a trial of strength and
bid defiance to the laws our country.
  --Thomas Jefferson


Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Wed, 5 Sep 2007 01:22:15 -0500 (CDT)
Dave Funk <db...@engineering.uiowa.edu> wrote:

> On Tue, 4 Sep 2007, Raquel wrote:
> 
> >>
> > bayes_path /usr/spamassassin/bayes
> > bayes_file_mode 0777
> 
> OK, is the directory "/usr/spamassassin" writable by the user-ID
> that you are running spamd as? What happens if you do a:
>     chmod 1777 /usr/spamassassin
> 
> and then retest?
> 
> Strong suggestion, do -not- put your bayes stuff into a directory
> that contains other SA components. Best to have a directory in
> your "/var" partition just for the bayes stuff.
> 
> 
> -- 
> Dave Funk
> 

Below are the relevant lines from my mail log after sending a
message from a Yahoo account.  I'll only be working on bits and
pieces today and won't be able to attack it until tomorrow.

Sep  5 09:07:11 bryce spamd[12836]: locker: safe_lock: cannot create
lockfile /usr/spamassassin/auto-whitelist.mutex: Permission denied

Sep  5 09:07:11 bryce spamd[12836]: auto-whitelist: open of
auto-whitelist file failed: locker: safe_lock: cannot create
lockfile /usr/spamassassin/auto-whitelist.mutex: Permission denied

Sep  5 09:07:11 bryce spamd[12836]: bayes: locker: safe_lock: cannot
create lockfile /usr/spamassassin/bayes.mutex: Permission denied

Sep  5 09:07:11 bryce sm-mta[16868]: l85G6RF0016868: Milter add:
header: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50
autolearn=failed \n\tversion=3.1.7-deb

Sep  5 09:07:11 bryce spamd[12837]: spamd: setuid to raquel
succeeded

Sep  5 09:07:29 bryce spamd[12837]: locker: safe_lock: cannot create
lockfile /usr/spamassassin/auto-whitelist.mutex: Permission denied

Sep  5 09:07:29 bryce spamd[12837]: auto-whitelist: open of
auto-whitelist file failed: locker: safe_lock: cannot create
lockfile /usr/spamassassin/auto-whitelist.mutex: Permission denied

Sep  5 09:07:29 bryce spamd[12837]: bayes: locker: safe_lock: cannot
create lockfile /usr/spamassassin/bayes.mutex: Permission denied


-- 
Raquel
============================================================
Bigotry is the disease of ignorance, of morbid minds; enthusiasm of
the free and buoyant. Education & free discussion are the antidotes
of both.
  --Thomas Jefferson


Re: autolearn=failed

Posted by maillist <ma...@emailacs.com>.
>>>
>>> As you want a site-wide Bayes, you also need the "bayes_path"
>>> parameter. What setting do you have for "bayes_path" (note it
>>> isn't a simple directory name).
>>>
>> bayes_path /usr/spamassassin/bayes
>> bayes_file_mode 0777
>
> OK, is the directory "/usr/spamassassin" writable by the user-ID that
> you are running spamd as? What happens if you do a:
>    chmod 1777 /usr/spamassassin
>
> and then retest?
>
> Strong suggestion, do -not- put your bayes stuff into a directory
> that contains other SA components. Best to have a directory in your 
> "/var"
> partition just for the bayes stuff.
>
>

In my experience, if you want your bayes directory to be 
"/usr/spamassassin/bayes" then you have to add this to your config:

bayes_path /usr/spamassassin/bayes/bayes

-=Aubrey=-

Re: autolearn=failed

Posted by Dave Funk <db...@engineering.uiowa.edu>.
On Tue, 4 Sep 2007, Raquel wrote:

> On Tue, 4 Sep 2007 16:34:49 -0500 (CDT)
> David B Funk <db...@engineering.uiowa.edu> wrote:
>
>> On Mon, 3 Sep 2007, Raquel wrote:
>>
>>> On Mon, 3 Sep 2007 18:31:03 -0700
>>> Raquel <ra...@thericehouse.net> wrote:
>>>
>>>> I'm setting up a new server.  However, email sent to the
>>>> server keeps getting "autolearn=failed".  I don't seem to be
>>>> able to figure out is causing that.
[snip..]
>>> My local.cf says:
>>>     bayes_auto_learn 1
>>>     use_bayes_rules 1
>>>     bayes_auto_learn_threshold_nonspam 0.1
>>>     bayes_auto_learn_threshold_spam 10
>>
>> As you want a site-wide Bayes, you also need the "bayes_path"
>> parameter. What setting do you have for "bayes_path" (note it
>> isn't a simple directory name).
>>
> bayes_path /usr/spamassassin/bayes
> bayes_file_mode 0777

OK, is the directory "/usr/spamassassin" writable by the user-ID that
you are running spamd as? What happens if you do a:
    chmod 1777 /usr/spamassassin

and then retest?

Strong suggestion, do -not- put your bayes stuff into a directory
that contains other SA components. Best to have a directory in your "/var"
partition just for the bayes stuff.


-- 
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{

Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Tue, 4 Sep 2007 16:34:49 -0500 (CDT)
David B Funk <db...@engineering.uiowa.edu> wrote:

> On Mon, 3 Sep 2007, Raquel wrote:
> 
> > On Mon, 3 Sep 2007 18:31:03 -0700
> > Raquel <ra...@thericehouse.net> wrote:
> >
> > > I'm setting up a new server.  However, email sent to the
> > > server keeps getting "autolearn=failed".  I don't seem to be
> > > able to figure out is causing that.
> > >
> > > --
> > > Raquel
> > >
> >
> > I should say that this server is Debian Etch w/spamassassin
> > version 3.1.7.
> >
> > My local.cf says:
> >     bayes_auto_learn 1
> >     use_bayes_rules 1
> >     bayes_auto_learn_threshold_nonspam 0.1
> >     bayes_auto_learn_threshold_spam 10
> 
> As you want a site-wide Bayes, you also need the "bayes_path"
> parameter. What setting do you have for "bayes_path" (note it
> isn't a simple directory name).
> 
> 
> -- 
> Dave Funk
> 

bayes_path /usr/spamassassin/bayes
bayes_file_mode 0777

-- 
Raquel
============================================================
If we cannot end now our differences, at least we can make the world
safe for diversity.
  --John F. Kennedy


Re: autolearn=failed

Posted by David B Funk <db...@engineering.uiowa.edu>.
On Mon, 3 Sep 2007, Raquel wrote:

> On Mon, 3 Sep 2007 18:31:03 -0700
> Raquel <ra...@thericehouse.net> wrote:
>
> > I'm setting up a new server.  However, email sent to the server
> > keeps getting "autolearn=failed".  I don't seem to be able to
> > figure out is causing that.
> >
> > --
> > Raquel
> >
>
> I should say that this server is Debian Etch w/spamassassin version
> 3.1.7.
>
> My local.cf says:
>     bayes_auto_learn 1
>     use_bayes_rules 1
>     bayes_auto_learn_threshold_nonspam 0.1
>     bayes_auto_learn_threshold_spam 10

As you want a site-wide Bayes, you also need the "bayes_path" parameter.
What setting do you have for "bayes_path" (note it isn't a simple
directory name).


-- 
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{

Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Mon, 3 Sep 2007 18:31:03 -0700
Raquel <ra...@thericehouse.net> wrote:

> I'm setting up a new server.  However, email sent to the server
> keeps getting "autolearn=failed".  I don't seem to be able to
> figure out is causing that.
> 
> -- 
> Raquel
> 

I should say that this server is Debian Etch w/spamassassin version
3.1.7.

My local.cf says:
    bayes_auto_learn 1
    use_bayes_rules 1
    bayes_auto_learn_threshold_nonspam 0.1
    bayes_auto_learn_threshold_spam 10

-- 
Raquel
============================================================
What is hateful you do not do to your neighbor: that is the whole
Torah.
  --Shammai


RE: autolearn=failed

Posted by Rob Sterenborg <R....@netsourcing.nl>.
Raquel wrote:
> On Mon, 03 Sep 2007 22:30:16 -0400
> Matt Kettler <mk...@verizon.net> wrote:
> 
>> Raquel wrote:
>>> 
>>> 
>>> I created a new user "spamassassin", with a password.  I call
>>> spamassassin-milter using the new user.  However, I'm still getting
>>> "autolearn=failed". 
>>> 
>> Interesting.. Could you detail how you called spamassassin-milter
>> using that new user? 
>> 
> 
> In Sendmail configuration I have:
>     INPUT_MAIL_FILTER(`spamassassin',
> `S=local:/var/run/sendmail/spamass.sock,
> F=,T=C:15m;S:4m;R:4m;E:10m')dnl
> 
> Then in /etc/defaults/spamass-milter:
>     OPTIONS="-u spamassassin -i 127.0.0.1"

You created a new user *with* password, but here I see only the username
(-u spamassassin). Do you also feed the password but don't show that, or
how is that user going to authenticate? AFAIK, if an account has a
password, a user cannot logon if the password is not supplied. Can it?


Grts,
Rob

Re: autolearn=failed

Posted by Matthias Leisi <ma...@leisi.net>.
> In Sendmail configuration I have:
>     INPUT_MAIL_FILTER(`spamassassin',
> `S=local:/var/run/sendmail/spamass.sock,
> F=,T=C:15m;S:4m;R:4m;E:10m')dnl
>
> Then in /etc/defaults/spamass-milter:
>     OPTIONS="-u spamassassin -i 127.0.0.1"

Maybe a dumb question: did you restart spamass-milter after changing the
config? Is spamass-milter actually taking up the config from
/etc/defaults/spamass-milter?

-- Matthias



Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Mon, 03 Sep 2007 22:30:16 -0400
Matt Kettler <mk...@verizon.net> wrote:

> Raquel wrote:
> >
> >
> > I created a new user "spamassassin", with a password.  I call
> > spamassassin-milter using the new user.  However, I'm still
> > getting "autolearn=failed".
> >   
> Interesting.. Could you detail how you called spamassassin-milter
> using that new user?
> 

In Sendmail configuration I have:
    INPUT_MAIL_FILTER(`spamassassin',
`S=local:/var/run/sendmail/spamass.sock,
F=,T=C:15m;S:4m;R:4m;E:10m')dnl

Then in /etc/defaults/spamass-milter:
    OPTIONS="-u spamassassin -i 127.0.0.1"

-- 
Raquel
============================================================
In the case of a Christian clergyman, the tragic-comical is found in
this: that the Christian religion demands love from the faithful,
even love for the enemy. This demand, because it is indeed
superhuman, he is unable to fulfill. Thus intolerance and hatred
ring through the oily words of the clergyman.
  --Albert Einstein


Re: autolearn=failed

Posted by Matt Kettler <mk...@verizon.net>.
Raquel wrote:
>
>
> I created a new user "spamassassin", with a password.  I call
> spamassassin-milter using the new user.  However, I'm still getting
> "autolearn=failed".
>   
Interesting.. Could you detail how you called spamassassin-milter using
that new user?




Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Mon, 03 Sep 2007 22:34:01 -0400
Matt Kettler <mk...@verizon.net> wrote:

> Raquel wrote:
> > I created a new user "spamassassin", with a password.  I call
> > spamassassin-milter using the new user.  However, I'm still
> > getting "autolearn=failed".
> >   
> 
> Wait.. Do you actually have the optional DB_File perl module
> installed? (required to support bayes unless you set it up using
> SQL)
> 
> That could also cause your autolearn=failed.. I think.. Theo will
> probably pop in and bonk me on the head if I'm wrong :)
> 

Yes, I installed DB_File.

-- 
Raquel
============================================================
I think the first duty of society is justice.
  --Alexander Hamilton


Re: autolearn=failed

Posted by Matt Kettler <mk...@verizon.net>.
Raquel wrote:
> I created a new user "spamassassin", with a password.  I call
> spamassassin-milter using the new user.  However, I'm still getting
> "autolearn=failed".
>   

Wait.. Do you actually have the optional DB_File perl module installed?
(required to support bayes unless you set it up using SQL)

That could also cause your autolearn=failed.. I think.. Theo will
probably pop in and bonk me on the head if I'm wrong :)




Re: autolearn=failed

Posted by Raquel <ra...@thericehouse.net>.
On Mon, 03 Sep 2007 21:40:44 -0400
Matt Kettler <mk...@verizon.net> wrote:

> Raquel wrote:
> > I'm setting up a new server.  However, email sent to the server
> > keeps getting "autolearn=failed".  I don't seem to be able to
> > figure out is causing that.
> >
> >   
> 
> Generally speaking, that means SpamAssassin can't write to the
> bayes database.
> 
> The most common cause of this is a spamd setup where everything is
> running as root. When this happens, spamd automatically setuid's
> itself to 'nobody' to avoid the security risk of scanning mail
> while running as root. 'nobody' does not, and should not, have
> access to write its home directory, so any bayes (or AWL) actions
> fail.
> 
> A quick and simple way to fix this is create a non-root user and
> pass it to spamc or spamd using the -u parameter. SA will create
> the bayes (and AWL if you use it) database in that user's home
> directory, and you should su to this user when running sa-learn or
> other bayes utilities.
> 
> 
> 

I created a new user "spamassassin", with a password.  I call
spamassassin-milter using the new user.  However, I'm still getting
"autolearn=failed".

-- 
Raquel
============================================================
Surely there comes a time when counting the cost and paying the
price aren't things to think about any more. All that matters is
value - the ultimate value of what one does.
  --James Hilton


Re: autolearn=failed

Posted by Matt Kettler <mk...@verizon.net>.
Raquel wrote:
> I'm setting up a new server.  However, email sent to the server
> keeps getting "autolearn=failed".  I don't seem to be able to figure
> out is causing that.
>
>   

Generally speaking, that means SpamAssassin can't write to the bayes
database.

The most common cause of this is a spamd setup where everything is
running as root. When this happens, spamd automatically setuid's itself
to 'nobody' to avoid the security risk of scanning mail while running as
root. 'nobody' does not, and should not, have access to write its home
directory, so any bayes (or AWL) actions fail.

A quick and simple way to fix this is create a non-root user and pass it
to spamc or spamd using the -u parameter. SA will create the bayes (and
AWL if you use it) database in that user's home directory, and you
should su to this user when running sa-learn or other bayes utilities.