0

I set up fail2ban on my Ubuntu server and specified an email address for notifications. I only want to be informed when a host is banned, but currently I get way to much emails with messages like

Hi, The jail apache-auth has been started successfully /stopped. Regards, Fail2Ban

How can I suppress this kind of notifications?

1 Answer 1

2

Comment out the actions in /etc/fail2ban/actions.d/mail.conf and replace them with an empty action:

#actionstart = printf %%b "Hi,\n
#              The jail <name> has been started successfully.\n
#              Regards,\n
#              Fail2Ban"|mail -s "[Fail2Ban] <name>: started  on `uname -n`" <dest>
actionstart = 
#actionstop = printf %%b "Hi,\n [...]
actionstop =
4
  • Thx, do you know what is meant by "starting/stoping" a jail? I get the more than once for each jail Commented Aug 29, 2016 at 13:45
  • From a quick glance at my fail2ban logs (running on debian) it seems that a jail is started when the fail2ban service is started. I only get this message once per jail in the logs. I don't have email notifications enabled, I would get hundreds of messages per day. Commented Aug 29, 2016 at 13:49
  • Unfortunately this doesnt work Commented Aug 29, 2016 at 17:19
  • @user2224350 Please see my edit. Commented Sep 5, 2016 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .