主题: fail2ban 的 dovecot.iredmail.conf 未阻擋到該擋的IP
==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:iRedMail 0.9.5-1
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):OpenLDAP
- 使用的 Linux/BSD 发行版名称及版本号:CentOS 7
- 与您的问题相关的日志信息:
====
#下面log 抓不到IP (dovecot.log檔)
Jan 04 17:40:55 auth: Info: ldap(root@mydomain,45.63.34.194): unknown user
Jan 05 20:07:04 auth: Info: ldap(root@mydomain,98.158.177.98): unknown user
Jan 05 20:06:50 auth: Info: ldap(test@mydomain,98.158.177.98): Login attempt with empty password
Jan 05 20:08:45 auth: Info: ldap(backup@mydomain,98.158.177.98): unknown user
Jan 05 20:08:45 auth: Info: ldap(mail@mydomain,98.158.177.98): unknown user
Jan 05 20:08:45 auth: Info: ldap(smtp@mydomain,98.158.177.98): unknown user
Jan 05 20:12:25 auth: Info: ldap(postmaster@mydomain,98.158.177.98): Login attempt with empty password
Jan 05 20:12:40 auth: Info: ldap(postmaster@mydomain,98.158.177.98): invalid credentials
grep '45.63.34.194' dovecot.log|wc -l
110
grep '98.158.177.98' dovecot.log|wc -l
1648
dovecot.iredmail.conf 或預設安裝的 dovecot.conf 皆無法抓到以上兩IP
現使用dovecot.iredmail.conf
最後兩行合併為一行:
^%(__prefix_line)s(auth|auth-worker\(\d+\)): (pam|passwd-file)\(\S+,<HOST>\): unknown user\s*$
^%(__prefix_line)s(auth|auth-worker\(\d+\)): Info: ldap\(\S*,<HOST>,\S*\): invalid credentials\s*$
#改為
(pam|passwd-file|dap)\(\S*,<HOST>(\)|\S*\)): (invalid credentials|unknown user|Login attempt with empty password)\s*$.
是可抓到;
不知版主有何其他看法意見.
Thanks.