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?

0

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 =
  • Thx, do you know what is meant by "starting/stoping" a jail? I get the more than once for each jail – user2224350 Aug 29 '16 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. – Gerald Schneider Aug 29 '16 at 13:49
  • Unfortunately this doesnt work – user2224350 Aug 29 '16 at 17:19
  • @user2224350 Please see my edit. – Gerald Schneider Sep 5 '16 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.