Fail2ban发送成功5封邮件后禁止我

亲爱的,我在CentOS 6系统上使用Fail2Ban v0.8.13来保护我的Postfix服务器。 基本上它工作,所以经过5 SMTP错误的login尝试,我被禁止。

Fail2Ban监狱conf

[sasl-iptables] enabled = true filter = sasl backend = polling action = iptables[name=sasl, port=smtp, protocol=tcp] sendmail-whois[name=sasl, dest=fail2ban@xxxx.ch, [email protected]] logpath = /var/log/maillog maxretry = 5 

我在main.cf中的sasl设置

 smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes 

我的smtp.conf(Postfix)

 pwcheck_method: saslauthd mech_list: login CRAM-MD5 DIGEST-MD5 

我的EHLO状态(后缀)

 EHLO mail.xxx.ch 250-mail.xxx.ch 250-PIPELINING 250-SIZE 50480000 250-VRFY 250-ETRN 250-STARTTLS 250-AUTH LOGIN CRAM-MD5 DIGEST-MD5 250-AUTH=LOGIN CRAM-MD5 DIGEST-MD5 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN 

我遇到的问题是,当我用MS Outlook 2016五次成功发送一封邮件时,第六封邮件被封锁。

我认为这是一个问题,因为Outlook尝试多重身份validation方法,其中一些失败之前login成功的SMTP Postfix服务器

有人有一个想法,我可以如何解决这个问题,例如,让成功login后Fail2Ban计数器重新设置? 或者我怎样才能优化后缀sasl设置,所以Outlook没有尝试多个auth方法,直到一个工程? 所以根据日志文件在MD5 Digest Method上失败,然后切换到Login方法。

从maillog提取(postfix

 Mar 8 23:38:44 postfix/smtpd[9295]: setting up TLS connection from 84-74-210-140.dclient.hispeed.ch[84.74.210.140] Mar 8 23:38:44 postfix/smtpd[9295]: Anonymous TLS connection established from 84-74-210-140.dclient.hispeed.ch[84.74.210.140]: TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits) Mar 8 23:38:44 postfix/smtpd[9295]: warning: SASL authentication failure: realm changed: authentication aborted Mar 8 23:38:44 postfix/smtpd[9295]: warning: 84-74-210-140.dclient.hispeed.ch[84.74.210.140]: SASL DIGEST-MD5 authentication failed: authentication failure Mar 8 23:38:45 postfix/smtpd[9295]: 0AF2127E0113: client=84-74-210-140.dclient.hispeed.ch[84.74.210.140], sasl_method=LOGIN, sasl_username=xxxx 

按照下面的讨论要求,我添加了Fail2ban的相关filter

后缀,sasl.conf

  failregex = ^%(__prefix_line)swarning: [-._\w]+\[<HOST>\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed(: [ A-Za-z0-9+/]*={0,2})?\s*$ 

sasl.conf

  failregex = ^%(__prefix_line)swarning: [-._\w]+\[<HOST>\]: SASL (?:LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed(: [ A-Za-z0-9+/]*={0,2})?\s*$ 

如果DIGEST-MD5与Outlook和Postfix一起正常工作,我没有find很多信息。 关于这个主题的大多数线索/讨论,我已经发现build议从机器清单中删除简单的DIGEST-MD5方法。

我的smtp.conf(Postfix)

 pwcheck_method: saslauthd mech_list: login CRAM-MD5