You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Michael Parker <pa...@pobox.com> on 2004/10/09 04:49:30 UTC

Re: 3.0.0 w/ mysql

On Fri, Oct 08, 2004 at 08:51:46PM -0600, lists@unixvault.com wrote:
> I'm having problems getting sa 3.0 to get user pref's from the mysql
> database.  I'm using Exim 4.43 with the latest exiscan patch compiled
> into it fyi.  I've entered @GLOBAL and my email address into the
> database, @GLOBAL is set to 5.2 required_hits and my email address et to
> 5.4.  I can't seem to get the custom query correct to have it use my
> pref's when an email is sent to me.
> 
> Keeps using user 'nobody' with the 5.2 required hits, I've tested this
> with sa in debug mode.  I used the example on the wiki page on
> spamassassins site, however once I get this working I'd like to know
> how I get it to select the correct user using CONCAT as I don't know if
> there are any variables you can CONCAT for the email username?  There
> are several domains on the server.
> 
> the example was:
> user_scores_sql_custom_query     SELECT preference, value FROM _TABLE_
> WHERE username = _USERNAME_ OR username = '$GLOBAL' OR username =
> CONCAT('%',_DOMAIN_) ORDER BY username ASC
> 
> my usersnames are in user@domain format.  so in the database say I have
> 
> user1@test.com            required_hits    4.0
> user2@test.com            required_hits    4.6
> user3@test123.com         required_hits    7.0
> user1@123test.com         required_hits    5.0
> and use @GLOBAL if the username isn't in the database.
> 
> I'm not sure how I would need to set the custom query up for that.
> 

>From what you've said, it doesn't sound like you need a custom query,
remove that line from your config file.

Probably the true cause of your problems is the fact that you either
aren't sending the Username to spamd or you are sending the wrong
username.  I'm not familar with exiscan so can't really help there.

Michael


Re: 3.0.0 w/ mysql

Posted by Michael Parker <pa...@pobox.com>.
On Fri, Oct 08, 2004 at 09:23:34PM -0600, lists@unixvault.com wrote:
> I took out the custom query, it's still choosing user 'nobody' when I
> send an email to my address.
> 
> logmsg: connection from localhost.localdomain [127.0.0.1] at port 46482
> debug: Conf::SQL: executing SQL: select preference, value  from userpref
> where u
> sername = 'nobody' or username = '@GLOBAL' order by username asc
> debug: retrieving prefs for nobody from SQL server
> debug: user has changed
> debug: bayes: 12772 tie-ing to DB file R/O /root/.spamassassin/bayes_toks
> debug: bayes: 12772 tie-ing to DB file R/O /root/.spamassassin/bayes_seen
> debug: bayes: found bayes db version 3
> 
> I'm not sure if I have a problem with the query (or how it needs to be
> setup to work successfully for multiple users and domains) or if it's a
> problem with exiscan not passing something.
> 
> thanks
> 

You need to send the the username to spamd.  As I said, you need to
read the documentation for exiscan to figure out how to send the
username to spamd for each scan.

Michael

Re: 3.0.0 w/ mysql

Posted by li...@unixvault.com.
I took out the custom query, it's still choosing user 'nobody' when I
send an email to my address.

logmsg: connection from localhost.localdomain [127.0.0.1] at port 46482
debug: Conf::SQL: executing SQL: select preference, value  from userpref
where u
sername = 'nobody' or username = '@GLOBAL' order by username asc
debug: retrieving prefs for nobody from SQL server
debug: user has changed
debug: bayes: 12772 tie-ing to DB file R/O /root/.spamassassin/bayes_toks
debug: bayes: 12772 tie-ing to DB file R/O /root/.spamassassin/bayes_seen
debug: bayes: found bayes db version 3

I'm not sure if I have a problem with the query (or how it needs to be
setup to work successfully for multiple users and domains) or if it's a
problem with exiscan not passing something.

thanks

On 10/9/2004, "Michael Parker" <pa...@pobox.com> wrote:

>> the example was:
>> user_scores_sql_custom_query     SELECT preference, value FROM _TABLE_
>> WHERE username = _USERNAME_ OR username = '$GLOBAL' OR username =
>> CONCAT('%',_DOMAIN_) ORDER BY username ASC
>>
>> my usersnames are in user@domain format.  so in the database say I have
>>
>> user1@test.com            required_hits    4.0
>> user2@test.com            required_hits    4.6
>> user3@test123.com         required_hits    7.0
>> user1@123test.com         required_hits    5.0
>> and use @GLOBAL if the username isn't in the database.
>>
>> I'm not sure how I would need to set the custom query up for that.
>>
>
>>From what you've said, it doesn't sound like you need a custom query,
>remove that line from your config file.
>
>Probably the true cause of your problems is the fact that you either
>aren't sending the Username to spamd or you are sending the wrong
>username.  I'm not familar with exiscan so can't really help there.
>
>Michael
>