On 06/30/2011 01:45 PM, J4K wrote:
> On 06/30/2011 11:37 AM, J4K wrote:
>> On 06/30/2011 11:09 AM, J4K wrote:
>>> On 06/29/2011 09:55 PM, Lawrence @ Rogers wrote:
>>>> On 29/06/2011 4:58 PM, JKL wrote:
>>>>> select count(spam_count) from bayes_vars
>>>> Run this query
>>>>
>>>> SELECT username,spam_count,ham_count FROM bayes_vars
>>>>
>>>> This will give a list of usernames that have been used to learn ham
>>>> and spam into SpamAssassin's Bayes MySQL DB. For a site-wide
>>>> installation, this should only return one result.
>>>>
>>>> To answer your previous question, I meant to simply add the
>>>> bayes_sql_override_username setting to your local.cf and restart
>>>> spamassassin
>>>>
>>>> If you are using Postfix with the postfix username, set it as
>>>>
>>>> bayes_sql_override_username postfix
>>>>
>>>> This ensures that all future e-mails are labeled as being learned from
>>>> the postfix user, regardless of whether you did it manually using
>>>> sa-learn via ssh or another interface, or auto-learning is used. For
>>>> one site-wide Bayes installation, this is what you want.
>>>>
>>>> Regards,
>>>> Lawrence
>>>>
>>> Hi there,
>>>
>>>
>>> This is the table I have in mysql, and the one I intend to populate with
>>> data:-
>>>
>>> mysql> describe bayes_vars;
>>> +--------------------+--------------+------+-----+------------+----------------+
>>> | Field              | Type         | Null | Key | Default    |
>>> Extra          |
>>> +--------------------+--------------+------+-----+------------+----------------+
>>> | id                 | int(11)      | NO   | PRI | NULL       |
>>> auto_increment |
>>> | username           | varchar(200) | NO   | UNI |           
>>> |                |
>>> | spam_count         | int(11)      | NO   |     | 0         
>>> |                |
>>> | ham_count          | int(11)      | NO   |     | 0         
>>> |                |
>>> | token_count        | int(11)      | NO   |     | 0         
>>> |                |
>>> | last_expire        | int(11)      | NO   |     | 0         
>>> |                |
>>> | last_atime_delta   | int(11)      | NO   |     | 0         
>>> |                |
>>> | last_expire_reduce | int(11)      | NO   |     | 0         
>>> |                |
>>> | oldest_token_age   | int(11)      | NO   |     | 2147483647
>>> |                |
>>> | newest_token_age   | int(11)      | NO   |     | 0         
>>> |                |
>>> +--------------------+--------------+------+-----+------------+----------------+
>>> 10 rows in set (0.00 sec)
>>>
>>>
>>> The configuration I intend to use for Bayes is:
>>>
>>> -------------------- START local.cf -------------------------------
>>> rewrite_header Subject *****SPAM*****
>>> report_safe 0
>>> report_hostname xxx.xxx.com
>>> dns_available yes
>>> use_dcc 1
>>> dcc_path /usr/local/bin/dccproc
>>> dcc_home /var/dcc
>>> use_pyzor 1
>>> pyzor_path /usr/bin/pyzor
>>> pyzor_timeout 5
>>> use_razor2 1
>>> razor_config /etc/razor/razor-agent.conf
>>> razor_timeout 5
>>>
>>> required_score 6.0
>>>
>>> use_bayes 1
>>> skip_rbl_checks 1
>>> bayes_auto_learn 0
>>> # bayes_auto_learn_threshold_nonspam    0.1
>>> # bayes_auto_learn_threshold_spam       13.0
>>>
>>> bayes_expiry_max_db_size                300000
>>> bayes_auto_expire                       1
>>>
>>> bayes_sql_override_username postfix 
>>> # I don't understand what this setting does, nor why its postfix.
>>> Postfix has no intereaction with SA in my set-up as postfix pipes the
>>> mail into dovecot,and dovecot handles the spamc portion before filing
>>> the email.
>>>
>>> |bayes_store_module              Mail::SpamAssassin::BayesStore::MySQL
>>> bayes_sql_dsn                   DBI:mysql:spamassassin:localhost
>>> bayes_sql_username              |shamster_user
>>> |bayes_sql_password              shamster||_password|
>>>
>>> ifplugin Mail::SpamAssassin::Plugin::Shortcircuit
>>> shortcircuit USER_IN_WHITELIST       on
>>> shortcircuit SUBJECT_IN_WHITELIST    on
>>> shortcircuit USER_IN_BLACKLIST       on
>>> shortcircuit SUBJECT_IN_BLACKLIST    on
>>>
>>> loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody
>>> endif
>>>
>>> score RDNS_DYNAMIC 2.639 0.363 1.663 1.700
>>> meta __PILL_PRICE_1  (0)
>>> meta __PILL_PRICE_2  (0)
>>> meta __PILL_PRICE_3  (0)
>>> -------------------- END local.cf -------------------------------
>>>
>>> N.B Yes, I know there are some custom rules in the local.cf and these'll
>>> be lost after an upgrade of SA, but I have reasonable backups.
>>>
>>> * Questions
>>> Does the configuration above look correct?
>>> Will SA only write into the table bayes_vars, or will it touch other tables?
>> Seems that some process butchered part of the config by discovering some
>> pipe characters.
>>
>> |bayes_store_module              Mail::SpamAssassin::BayesStore::MySQL
>> bayes_sql_dsn                   DBI:mysql:spamassassin:localhost
>> bayes_sql_username              |shamster_user
>> |bayes_sql_password              shamster||_password|
>>
>> Above should have read:
>> |bayes_store_module              Mail::SpamAssassin::BayesStore::MySQL
>> bayes_sql_dsn                   DBI:mysql:spamassassin:localhost
>> bayes_sql_username              sa_user
>> bayes_sql_password              sa_user_password|
>>
>> Other question: If the above looks correct, is that somethin else that I
>> ought to enable?  e.g plugins for mysql, or a particular perl module
>> that I might have omitted?
>>
>> Regards, S.
> Regarding local.cf
>
> Should the password be quoted such as in single quotes?
>
> The password has many strange chars in it e.g
>     bayes_sql_password    fg$%-)_()(Wsuisrt{^%TEST
 I restarted this:

(Grepped for bayes on o/p of spamassassin -D --lint)

Jun 30 15:05:09.024 [1707] dbg: plugin: loading
Mail::SpamAssassin::Plugin::Bayes from @INC
Jun 30 15:05:09.191 [1707] dbg: config: fixed relative path:
/var/lib/spamassassin/3.003001/updates_spamassassin_org/23_bayes.cf
Jun 30 15:05:09.191 [1707] dbg: config: using
"/var/lib/spamassassin/3.003001/updates_spamassassin_org/23_bayes.cf"
for included file
Jun 30 15:05:09.191 [1707] dbg: config: read file
/var/lib/spamassassin/3.003001/updates_spamassassin_org/23_bayes.cf
Jun 30 15:05:11.370 [1707] dbg: plugin:
Mail::SpamAssassin::Plugin::Bayes=HASH(0x330a248) implements
'learner_new', priority 0
Jun 30 15:05:11.371 [1707] dbg: bayes: learner_new
self=Mail::SpamAssassin::Plugin::Bayes=HASH(0x330a248),
bayes_store_module=Mail::SpamAssassin::BayesStore::MySQL
Jun 30 15:05:11.382 [1707] dbg: bayes: using username: postfix
Jun 30 15:05:11.382 [1707] dbg: bayes: learner_new: got
store=Mail::SpamAssassin::BayesStore::MySQL=HASH(0x2c83040)
Jun 30 15:05:11.383 [1707] dbg: plugin:
Mail::SpamAssassin::Plugin::Bayes=HASH(0x330a248) implements
'learner_is_scan_available', priority 0
Jun 30 15:05:11.385 [1707] dbg: bayes: database connection established
Jun 30 15:05:11.386 [1707] dbg: bayes: found bayes db version 3
Jun 30 15:05:11.386 [1707] dbg: bayes: unable to initialize database for
postfix user, aborting!
Jun 30 15:05:11.400 [1707] dbg: bayes: database connection established
Jun 30 15:05:11.400 [1707] dbg: bayes: found bayes db version 3
Jun 30 15:05:11.400 [1707] dbg: bayes: unable to initialize database for
postfix user, aborting!


this is message I should look into:
Jun 30 15:05:11.386 [1707] dbg: bayes: unable to initialize database for
postfix user, aborting!

I imagine that this is related to the

bayes_sql_override_username postfix 

I thought that this only affected the user in the dB that the data was stored 
under: Is it complaining that there is not a mysql user called postfix, or does 
it want an entry in a column for a user called postfix?

Regards, S.

PS. This EMail Subject changed as is now misleading.

Reply via email to