Fail2ban MTA=Jail 配置中的后缀设置给出错误

Nee*_*eel 1 email-server postfix iptables jail fail2ban

在 中/etc/fail2ban/jail.local,当我将 MTA 设置为 Postfix 时,Fail2Ban 显示错误并且无法启动。

[DEFAULT]

ignoreip = 127.0.0.1/8
bantime  = 1800                         
maxretry =  4                           
destemail = email@example.com   
mta = postfix                           
action = %(action_mwl)s 
Run Code Online (Sandbox Code Playgroud)

错误:

WARNING 'findtime' not defined in 'ssh'. Using default value
ERROR  /etc/fail2ban/action.d/postfix-whois-lines.conf and /etc/fail2ban/action.d/postfix-whois-lines.local do not exist
ERROR  Error in action definition postfix-whois-lines[name=ssh, dest="email@example.com", logpath=/var/log/auth.log, chain="INPUT"]
ERROR  Errors in jail 'ssh'. Skipping...
['set', 'loglevel', 3]
['set', 'logtarget', '/var/log/fail2ban.log']
Run Code Online (Sandbox Code Playgroud)

错误指向其他地方,但是当我注释掉mta=postfix它时。

我有后缀为我的MTA(在Debian 7)安装,我想我应该改变默认sendmailpostfix这个设置。我错了吗?

小智 5

看看我的/etc/fail2ban/jail.local有这样的评论:

Since 0.8.1 upstream fail2ban uses sendmail MTA for the mailing. 
Change mta configuration parameter to mail if you want to revert to conventional 'mail'
Run Code Online (Sandbox Code Playgroud)

基于此和您发布的错误,您似乎只能指定sendmailmail

mta设置为时,您是否会收到来自 fail2ban 的电子邮件sendmail

  • 当 postfix 也是一种流行的 mta 使用时,为什么它只使用 sendmail 或 mail ,这很奇怪。文件中的注释在说要指定 fail2ban 需要使用的 mta 时具有误导性。 (2认同)