Bug 5346 - Add config option for SQL queries for Bayes
Summary: Add config option for SQL queries for Bayes
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 3.1.8
Hardware: All other
: P5 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
Depends on:
Reported: 2007-02-21 08:25 UTC by C. Bensend
Modified: 2007-04-29 17:09 UTC (History)
0 users

Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description C. Bensend 2007-02-21 08:25:49 UTC
I was not sure what component to classify this as - please reclassify if this
one is not correct.

I would _love_ to see an option for Bayes SQL queries, similar to the
user_scores_sql_custom_query option for userprefs.

Scenario:  I have a domain with many mailboxes, but they all belong to me.  I
would love to be able to query for username/domainname/default values for the
username to learn and query Bayes.

As of right now, my main address (benny@bennyvision.com) is the only one that
can use Bayes on my domain, without re-calling sa-learn for each and every
mailbox.  With a user_bayes_sql_custom_query option (or similar), I could reduce
the username to '%bennyvision.com' and use that for _all_ mailboxes.

It'd really be nice.  :)

I realize part of this problem is how I'm calling spamc and sa-learn - I use
simscan, which grabs the first email address it finds.  This config works best
for me and my other domains (not run by me), so I'm stuck.  Adding this option
should not break other configurations as long as a sensible sample SQL query was

Please don't hesitate to club me over the head if I'm missing something.
Comment 1 Michael Parker 2007-02-21 08:33:49 UTC
How about just using the bayes_sql_override_username configuration variable?
Comment 2 C. Bensend 2007-04-29 17:09:35 UTC
(In reply to comment #1)
> How about just using the bayes_sql_override_username configuration variable?

Hi Michael,

   I'm very sorry - I don't know if I didn't get an email when you posted this
comment, or if it got marked as spam or something.  :(  I had no idea you had
replied.  I apologize.

   I checked out this option in Mail::SpamAssassin::Conf, and it looks
promising.  Is it as simple as:

INSERT INTO userpref ( username, preference, value ) VALUES (
'%bennyvision.com', 'bayes_sql_override_username', 'benny@bennyvision.com' );


   Would this force all of my other usernames on the bennyvision.com domain to
use the 'benny@bennyvision.com' as the username for Bayes?  I just want to make
sure I understand the use of this option as well as any risks that might be

   Thank you so much, and again - I'm sorry I missed your comment way back then.