> Many of my Bayes db's (not SQL) can't be expired anymore because the > --force-expire run can't find a delta that is big enough or so. I tried > with several settings for max_size that would either expire only a few or > most of the db and some steps in-between. Always the same problem. Is > there a way or script that can *really* enforce an expire? > I don't want to throw them away as they are working quite fine. But I also > don't want them to grow indefinitely (now at around 3-4 million tokens).
If you have 3-4 million tokens you need SQL (mysql, change to INNODB tables) and I have a script that will create a new baysian table and just send 'newest' stuff to it. Full script available if you want, but basicilly you stop spamd, In mysql: create table bayes_token_new like bayes_token; insert into bayes_token_new (select * from bayes_token order by id,atime desc limit 1000000); (I am using amavisd.. It has only one id, so I don't know what they would do to SA. In amavisd I didn't use the id key, but you might need it to trigger index. Also, you could get clever and only load 'interesting' tokens, something like 'where ham_count > 8 or spam_count > 8') Would give you 1MM tokens (note: will take a long time, atime isn't a direct key. You could limit by id (select * from bayes_vars), something like: Insert into bayes_token_new (select * from bayes_token where id=1 order by atime, desc). Don't forget to update bayes_vars, rename table and restart spamd. Might allow more than 1mm tokens with above, then force a bayes-expire just in case. (with a max_db < 1mm) WMMY, suggestion void where prohibited or taxed. -- Michael Scheidell, CTO >|SECNAP Network Security Winner 2008 Network Products Guide Hot Companies FreeBSD SpamAssassin Ports maintainer _________________________________________________________________________ This email has been scanned and certified safe by SpammerTrap(r). For Information please see http://www.spammertrap.com _________________________________________________________________________