Disable Fail2ban Service Emails

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.

# Disable fail2ban jails start/stop/restart emails
cat << EOF >> /etc/fail2ban/action.d/disable-service-email.local
actionstart =
actionstop =
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
Did you find this article useful? Why not share it with your friends?

2 thoughts on “Disable Fail2ban Service Emails

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.