Database Maintenance

Credits

Various bits of code, scripts, and procedures were put together with information from John Simpson's qmail.jms1.net website. It's an excellent resource on managing and setting up a Qmail server.

Nightly script to purge the dspam database of old information.

Performance Tuning

Copy the SQL purge script from the source directory:

mkdir /var/dspam/sql
cp /extra/src/dspam-3.10.2/src/tools.mysql_drv/purge-4.1.sql \
/var/dspam/sql/mysql_purge-4.1.sql

Copy the maintenance script:

cp /extra/src/dspam-3.10.2/contrib/dspam_maintenance/dspam_maintenance.sh \
/usr/local/bin/dspam_maintenance

Edit the script with some default options:

DSPAM_CONFIGDIR="/usr/local/etc"
DSPAM_HOMEDIR="/var/dspam"
DSPAM_PURGE_SCRIPT_DIR="/var/dspam/sql"
DSPAM_BIN_DIR="/usr/local/bin"
MYSQL_BIN_DIR="/usr/local/mysql/bin"

Test the script out:

/usr/local/bin/dspam_maintenance --verbose

Create a cron task to run it nightly:

cd /etc/cron.d
echo "0 0 * * * root /usr/local/bin/dspam_maintenance >/dev/null 2>&1" > dspam
touch /etc/crontab

Optimizing purge-4.1.sql

Purging a user
Script to delete dspam users

Recent Updates

  • 8 months 3 weeks ago
    1.27.2 update
  • 9 months 3 days ago
    Drupal 10/11 config
  • 9 months 5 days ago
  • PHP
    9 months 5 days ago
    PHP 8.3.11 and AlmaLinux
  • 9 months 5 days ago
    New version of Pound