You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Matthew Schumacher <ma...@aptalaska.net> on 2005/07/26 00:58:26 UTC

bayes_sql_username doesn't work in 3.1.0pre4/postgres.

It seems that sa always tries to login to the db as the running user
instead of the defined db user.  Is this the expected behavior?  If so
the documentation should be changed.

schu

Re: bayes_sql_username doesn't work in 3.1.0pre4/postgres.

Posted by Michael Parker <pa...@pobox.com>.
Matthew Schumacher wrote:

>Thanks for your reply Michael.
>
>After further looking, the problem isn't the username or the connect_db
>method, it's the _initialize_db method that is failing.
>
>The debugging prints, "unable to initialize database for nobody user,
>aborting!" which caused me to think that it was trying to connect as
>nobody, but then discovered that initialize and connect where different
>things.
>
>I tracked down where _initialize_db() returns 0, it's at line 1750:
>
>return 0 unless ($create_entry_p);
>
>I'm not sure what this is for, but whatever it is, it keeps the database
>from becoming initialized which is causing bayes to not work for me.
>
>Any information on how to get around this would be great...
>
>  
>
We only attempt to create the database when we want to write information
to the database.  So, are you trying a write operation?  Like an
sa-learn --spam or something like that.  A simple --dump will no longer
create the database if it doesn't already exist.  Similarly, if you run
spamassassin -D --lint it won't attempt to create the database since the
check for bayes in a readonly operation.  Try learning a message, and if
that doesn't work, try learning a msg with sa-learn -D and send the
output to the list.

Michael

Re: bayes_sql_username doesn't work in 3.1.0pre4/postgres.

Posted by Matthew Schumacher <ma...@aptalaska.net>.
Michael Parker wrote:
> Matthew Schumacher wrote:
> 
> 
>>It seems that sa always tries to login to the db as the running user
>>instead of the defined db user.  Is this the expected behavior?  If so
>>the documentation should be changed.
>>
>>schu
>>
>> 
>>
> 
> Nothing is that code has changed in forever, so you're gonna have to
> provide a little more information.  I know for a fact that it is working
> just fine for MySQL, I haven't' used it under Postgresql in a while but
> the principle is the same.  Are you certain you didn't misspell the
> option or something?  Try running spamassassin --lint and see what it says.
> 
> Michael

Thanks for your reply Michael.

After further looking, the problem isn't the username or the connect_db
method, it's the _initialize_db method that is failing.

The debugging prints, "unable to initialize database for nobody user,
aborting!" which caused me to think that it was trying to connect as
nobody, but then discovered that initialize and connect where different
things.

I tracked down where _initialize_db() returns 0, it's at line 1750:

return 0 unless ($create_entry_p);

I'm not sure what this is for, but whatever it is, it keeps the database
from becoming initialized which is causing bayes to not work for me.

Any information on how to get around this would be great...

thanks,

schu

Re: bayes_sql_username doesn't work in 3.1.0pre4/postgres.

Posted by Michael Parker <pa...@pobox.com>.
Matthew Schumacher wrote:

>It seems that sa always tries to login to the db as the running user
>instead of the defined db user.  Is this the expected behavior?  If so
>the documentation should be changed.
>
>schu
>
>  
>
Nothing is that code has changed in forever, so you're gonna have to
provide a little more information.  I know for a fact that it is working
just fine for MySQL, I haven't' used it under Postgresql in a while but
the principle is the same.  Are you certain you didn't misspell the
option or something?  Try running spamassassin --lint and see what it says.

Michael