This article is a follow up to our previous article Postfix Brute Force Prevention. If you are running Fail2ban on Debian or Ubuntu Server as described in our previous article, then you are aware that you will receive an email every time the Fail2ban service is stopped, started or restarted. While we would certainly like to receive emails on a ban action, we don’t need to be notified of the service status with emails. Below we will provide a script that you can run to disable the service status emails without modifying any of the Fail2ban default configuration files.
#!/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
Finally a solution to this problem that really works. Thanks a ton!
Glad to help Stefan