Richard
The Dspam database gets very big after a while because it’s stores all the important stuff of all the emails that pass through it. All the keywords and the status of the email is stored and if you receive a lot of mail that database grows considerably. To keep the information in the Dspam database fresh and the system nimble we need to purge the database every now and then.
This removes all the the old keywords from the database, being older than 90 days and not seen after that. This means that the nuber of keywords that are checked are kept to a certain limit. This purging helps to improve the accuracy of the spam filter as it no longer checks on keywords no longer in use.
To purge the database every now and then you need to follow the next steps:
From the dspam source archive copy the purge file to ‘/usr/local/var/dspam/‘
Create a script called ‘dspam.purge‘ in the location ‘/etc/periodic/weekly‘ to have the script executed on a weekly basis. The content of the file should look like:
PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
export PATH
MYSQL=/usr/local/mysql/bin/mysql
echo “Purging the Dspam database”
$MYSQL –password=dspampassword dspam –user=dspamuser < /usr/local/var/dspam/purge-4.1.sql
Don’t forget to change the userid and password to those you have configured for your database and you have to make the script executable by using the following command:
Dspam should be performing better now on the long run.



Comments
4:52 am
When you say the userid and password for the database you are talking about the dspam database and not the postfix db yes?
5:40 am
Yes you are very correct!. User and password for the dspam database are to be used.
11:28 am
Have you tried to use the script found in GIT for that task?
http://dspam.git.sourceforge.net/git/gitweb.cgi?p=dspam/dspam;a=tree;f=contrib/dspam_maintenance;hb=HEAD
The script does not only perform the purging of the old tokens/signatures but does as well purge the system and user log.
–
Kind Regards from Switzerland,
Stevan Bajić
1:46 pm
@Stevan, no. This is an old script which I used for 3.6.8. I need to update everythign to bring it in line with the latest DSpam version and Snow Leopard.