Disable Fail2Ban email notifications

How to disable Fail2Ban notifications through email when an IP is banned ?

You have to create a bash script :

nano /usr/local/bin/stopfail2banemail.sh

Add :

#!/bin/bash
#
# Disable fail2ban jails start/stop/restart emails
#
#
cat << EOF >> /etc/fail2ban/action.d/disable-service-email.local
[Definition]
actionstart =
actionstop =
EOF
cd /etc/fail2ban/action.d/
ln -s disable-service-email.local mail.local
ln -s disable-service-email.local mail-buffered.local
ln -s disable-service-email.local mail-whois.local
ln -s disable-service-email.local mail-whois-lines.local
ln -s disable-service-email.local sendmail.local
ln -s disable-service-email.local sendmail-buffered.local
ln -s disable-service-email.local sendmail-whois.local
ln -s disable-service-email.local sendmail-whois-lines.local

Save and exit.

Run the script :

bash /usr/local/bin/stopfail2banemail.sh
Share

2
Leave a Reply

avatar
2 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
weborus Recent comment authors
  Subscribe  
newest oldest most voted
Notify of