You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Jason Frisvold <xe...@gmail.com> on 2004/10/10 22:48:44 UTC

sa-learn sql with username ?

Hi all,

I'm trying to implement SQL Bayes and I need a little help.  I have
the bayes database set up and it does seem to work properly.  However,
sa-learn seems to be placing the ham and spam into the database for
the user the command is run as.  How do I override the username so
that the ham/spam is applied to the proper user?

I see the bayes_sql_override_username option, but how do I pass this
dynamically on the command-line?

I have been looking through the archives, but I haven't found the
answer yet.  Any help would be appreciated!

Thanks,

-- 
Jason 'XenoPhage' Frisvold
XenoPhage0@gmail.com

Re: sa-learn sql with username ?

Posted by Jason Frisvold <xe...@gmail.com>.
On Tue, 12 Oct 2004 07:31:36 -0700, p dont think
<pd...@angrynerds.com> wrote:

> FYI, we are planning to extend the following wrapper method by spitting
> out a temporary conf file with the correct username in it, and deleting
> the conf file when done:
> 
> http://jousset.org/pub/sa-postfix.en.html

That is essentially what I have done in order to get this working. 
I'm using the sasql plugin for squirrelmail and needed a way to
provide the username to the process_spam.pl script.  I hacked the
temporary conf file bit into the script and it runs perfectly.  I
think the next step is to determine how to speed up the process.  It
seems that the process_spam script processes each piece of mail
individually, thus slowing the system down considerably.  If anyone
has already done this, please let me know.. re-inventing the wheel is
usually a waste of time ...


-- 
Jason 'XenoPhage' Frisvold
XenoPhage0@gmail.com

Re: sa-learn sql with username ?

Posted by p dont think <pd...@angrynerds.com>.

Jason Frisvold wrote:
>>You mean this?
>>http://bugzilla.spamassassin.org/show_bug.cgi?id=3766
> 
> 
> Awesome, thanks for the link :)
> 
> It's always interesting to watch the flow of thinking for something
> like this...  I can agree with both sides of the permissions issue... 
> In my case, the only users with direct access to the server are
> admins, so I don't have an issue with non-root users, per se.. 
> However, in the interest of security, I do think it's a good idea to
> only let the root/spamd user run that command...
> 
> It seems there's no clear-cut answer for this..  I wonder if it's
> possible to turn this on/off via some config option?

FYI, we are planning to extend the following wrapper method by spitting 
out a temporary conf file with the correct username in it, and deleting 
the conf file when done:

http://jousset.org/pub/sa-postfix.en.html


Re: sa-learn sql with username ?

Posted by Jason Frisvold <xe...@gmail.com>.
> You mean this?
> http://bugzilla.spamassassin.org/show_bug.cgi?id=3766

Awesome, thanks for the link :)

It's always interesting to watch the flow of thinking for something
like this...  I can agree with both sides of the permissions issue... 
In my case, the only users with direct access to the server are
admins, so I don't have an issue with non-root users, per se.. 
However, in the interest of security, I do think it's a good idea to
only let the root/spamd user run that command...

It seems there's no clear-cut answer for this..  I wonder if it's
possible to turn this on/off via some config option?

> Michael
> 


-- 
Jason 'XenoPhage' Frisvold
XenoPhage0@gmail.com

Re: sa-learn sql with username ?

Posted by Michael Parker <pa...@pobox.com>.
On Mon, Oct 11, 2004 at 04:02:04PM -0700, Loren Wilton wrote:
> > that's sufficient...  It would be *REALLY* nice if sa-learn accepted
> > the username as an argument, but for now, this will do ....
> 
> It appears that spamd will soon allow a username parameter.
> I'd suggest a Bugzilla NFS to add the same parameter to sa-learn.
> Might get both at once.
> 

You mean this?
http://bugzilla.spamassassin.org/show_bug.cgi?id=3766

Michael

Re: sa-learn sql with username ?

Posted by Loren Wilton <lw...@earthlink.net>.
> that's sufficient...  It would be *REALLY* nice if sa-learn accepted
> the username as an argument, but for now, this will do ....

It appears that spamd will soon allow a username parameter.
I'd suggest a Bugzilla NFS to add the same parameter to sa-learn.
Might get both at once.


        Loren


Re: sa-learn sql with username ?

Posted by Jason Frisvold <xe...@gmail.com>.
On Mon, 11 Oct 2004 09:38:32 -0400, Jason Frisvold <xe...@gmail.com> wrote:
> But therein lies the problem...  I don't have a local.cf file for each
> user because the users are virtual.  I was hoping to avoid using
> local.cf files because I'm using SQL to allow shared use of the bayes
> and spamassassin database, as well as failover to other servers.
> 
> So, I suppose I need to dynamically generate a local.cf file
> temporarily for sa-learn to run against in order to accomplish this...
>  Not a huge problem, I was just hoping for a more elegant solution..

Well...  This worked..  I'm able to create a temporary local.cf file
for each user and point sa-learn at that ...  It works, and for now
that's sufficient...  It would be *REALLY* nice if sa-learn accepted
the username as an argument, but for now, this will do ....

-- 
Jason 'XenoPhage' Frisvold
XenoPhage0@gmail.com

Re: sa-learn sql with username ?

Posted by Jason Frisvold <xe...@gmail.com>.
On Mon, 11 Oct 2004 09:15:20 -0400 (EDT), Keith Hackworth
<ke...@rpemail.com> wrote:
> I ran into the same problem.  All I had to do was set the
> bayes_sql_override_username value in my local.cf and it took care of it
> for me.  When I do a sa-learn [spam|ham], it loads in as the user I
> specified in my local.cf.

But therein lies the problem...  I don't have a local.cf file for each
user because the users are virtual.  I was hoping to avoid using
local.cf files because I'm using SQL to allow shared use of the bayes
and spamassassin database, as well as failover to other servers.

So, I suppose I need to dynamically generate a local.cf file
temporarily for sa-learn to run against in order to accomplish this...
 Not a huge problem, I was just hoping for a more elegant solution..
 
> Keith

Thanks!


-- 
Jason 'XenoPhage' Frisvold
XenoPhage0@gmail.com

Re: sa-learn sql with username ?

Posted by Keith Hackworth <ke...@rpemail.com>.
I ran into the same problem.  All I had to do was set the
bayes_sql_override_username value in my local.cf and it took care of it
for me.  When I do a sa-learn [spam|ham], it loads in as the user I
specified in my local.cf.

Keith


> Hi all,
>
> I'm trying to implement SQL Bayes and I need a little help.  I have
> the bayes database set up and it does seem to work properly.  However,
> sa-learn seems to be placing the ham and spam into the database for
> the user the command is run as.  How do I override the username so
> that the ham/spam is applied to the proper user?
>
> I see the bayes_sql_override_username option, but how do I pass this
> dynamically on the command-line?
>
> I have been looking through the archives, but I haven't found the
> answer yet.  Any help would be appreciated!
>
> Thanks,
>
> --
> Jason 'XenoPhage' Frisvold
> XenoPhage0@gmail.com
>