我在 Ubuntu 服务器上设置了 fail2ban,并指定了一个用于接收通知的电子邮件地址。我只希望在主机被禁止时收到通知,但目前我收到了太多电子邮件,其中包含类似以下消息
您好,jail apache-auth 已成功启动/停止。问候,Fail2Ban
我怎样才能抑制此类通知?
答案1
注释掉操作/etc/fail2ban/actions.d/mail.conf
并用空操作替换它们:
#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 =