• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Fail2ban filter courier imap fails.

JuanCar

Regular Pleskian
Server operating system version
Centos 7
Plesk version and microupdate number
Obsidian 18.0.48
My fail2ban doesn't ban this kind of records

myserver courier-imaps: LOGIN FAILED, user=[email protected], ip=[::ffff:185.30.177.79], port=[3609]

I see that plesk-courierimap jail should ban the ip of this record.
This jail uses the filter plesk-courierlogin, which includes the regexp

failregex = ^%(__prefix_line)sLOGIN FAILED, (?:user|method)=.*, ip=\[<HOST>\]$

I think this is is not the proper regexp for this kind of records, because of the , port=[3609]
It would be something like :

failregex = ^%(__prefix_line)sLOGIN FAILED, (?:user|method)=.*, ip=\[<HOST>\].*$

With this regexp the fail2ban jail should ban both IP in these records
myserver courier-imaps: LOGIN FAILED, user=[email protected], ip=[::ffff:185.30.177.79], port=[3609]
myserver courier-imaps: LOGIN FAILED, user=[email protected], ip=[::ffff:185.30.177.77]


Am I right?
 
The rule is not exactly false. On my test systems it yields results. But sure you can expand it as suggested. After have adapted the rule, you can test what it does using the fail2ban-regex utility, e.g. # fail2ban-regex /var/log/maillog /etc/fail2ban/filter.d/plesk-courierlogin.conf. For a new rule to take effect, reload the corresponding jail # fail2ban-client reload plesk-courierimap.
 
Back
Top