exim+exiscan+spamassassin+mysql

Lance <[email protected]> Wed, 27 Oct 2004 15:43:34 -0600
Newsgroups gmane.mail.exim.exiscan.user
Message-ID <[email protected]>
I've been looking into this more but havn't found anything to help
resolve the problem.

I'm using exim 4.43+exiscan-acl-28 with SpamAssassin 3.0.0 trying to get
sa3 to pull preferences from mysql.  For virtual email in exim we're
using $local_part and $domain..  usernames would then =
$local_part@$domain (user@domain) just so everyone who doesn't know
exim this is how it is in the conf.  I've created a db for spamassassin
with:

username              preference        value      prefid
---------------------------------------------------------
@GLOBAL               required_hits     5.2        1
[email protected]   required_hits     3.0        2

I start sa with -q to pull from the db, using the default query it
selects user 'nobody'..  I've tried:

user_scores_sql_custom_query    SELECT preference, value FROM _TABLE_
WHERE
username = CONCAT(_USERNAME_) OR username = '@GLOBAL'

as well as:
user_scores_sql_custom_query    SELECT preference, value FROM _TABLE_
WHERE
username = _USERNAME_ OR username = '@GLOBAL'

I even broke the user/domain down in the sa db, and added a domain field
to the db and tried:
user_scores_sql_custom_query    SELECT preference, value FROM _TABLE_
WHERE
username = CONCAT(_USERNAME_'@'_DOMAIN_) OR username = '@GLOBAL'

_USERNAME_ in the debug info is ALWAYS 'nobody'.  I've yet to get an
answer to this problem as if its a problem with my query, config, or if
exiscan isn't passing something it should be? _DOMAIN_ when used in the
query is always NULL also...

I'm going to continue to reply to posts in the sa list and exiscan list,
sa list blames exiscan and exiscan list blames sa and I'm tired of
going in circles with this.

Lance


On 10/9/2004, "[email protected]" <[email protected]> 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
>
>On 10/9/2004, "Michael Parker" <[email protected]> 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
>>>
>>> [email protected]            required_hits    4.0
>>> [email protected]            required_hits    4.6
>>> [email protected]         required_hits    7.0
>>> [email protected]         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
>>