[postban.sh] new release
Posted: 08 Nov 2016 08:54
This simple script scan incoming messages each minute,
Only if it found some spam in the last minute it rebuild the ip ban table and pass it to postfix.
this table tell to postfix to reject messages from spam ip, they are ip that recently sent spam without sending some ham
Put attached file postban.sh in a dir (example /batch/postban.sh)
chmod 777 /batch/postban.sh
Put in root cron a line that execute this script every minute :
* * * * * /batch/postban.sh > /dev/null
Modify your main.cf in postfix at this line like here and then postfix reload :
smtpd_client_restrictions = (OTHER YOUR PARAMETERS) check_client_access hash:/etc/postfix/postban_access
Set your ROOTPWD of your mysql server in postban.sh Parameters section
Set your RJMESSAGE in postban.sh Parameters section
Optionally set other parameters in postban.sh Parameters section
You can see working in /batch/postban.log
Only if it found some spam in the last minute it rebuild the ip ban table and pass it to postfix.
this table tell to postfix to reject messages from spam ip, they are ip that recently sent spam without sending some ham
Put attached file postban.sh in a dir (example /batch/postban.sh)
chmod 777 /batch/postban.sh
Put in root cron a line that execute this script every minute :
* * * * * /batch/postban.sh > /dev/null
Modify your main.cf in postfix at this line like here and then postfix reload :
smtpd_client_restrictions = (OTHER YOUR PARAMETERS) check_client_access hash:/etc/postfix/postban_access
Set your ROOTPWD of your mysql server in postban.sh Parameters section
Set your RJMESSAGE in postban.sh Parameters section
Optionally set other parameters in postban.sh Parameters section
You can see working in /batch/postban.log