SpamSnake Greylisting Crontab

Discussion in 'HOWTO-Related Questions' started by getrav, May 9, 2008.

  1. getrav

    getrav New Member

    I didn't understand the instructions so clearly:

    You can set up a cron job to keep your database clean. Below is what I'm using in crontab -e running at midnight.

    @daily /usr/bin/mysql -ugld_user -pgld_password -e 'USE gld_db; DELETE FROM greylist WHERE n > 0;' &> /dev/null
  2. Rocky

    Rocky Member

    Since greylisting is a way of making emails reject temporarily and then come back after a set amount of time, I wanted a way of cleaning out the database. After the mail returns, be it ham or spam, then it hits the gld_db 2 times, which means if it comes back again, it will be allowed to pass through without any checks. My cronjob is a measure to refresh my gld_db daily to ensure that mails get checked daily.

    @daily /usr/bin/mysql -ugld_user -pgld_password -e 'USE gld_db; DELETE FROM greylist WHERE n > 0;' &> /dev/null

    I did crontab -e and entered the above exactly as you see it, changing the gld_user and gld_password according for my setup. It cleans out the database every night at midnight. It basically deletes everything out of the greylist table and does not touch the whitelist table. The whitelist table basically contains all those domains/email addresses that you want to allow. They will be skipped by the greylist daemon.

    I hope this helps.

Share This Page