Block bad access with fail2ban.

Install

apt install fail2ban

Postfix

vi /etc/fail2ban/jail.d/postfix.conf

[postfix]
enabled = true
mode = aggressive

dovecot

vi /etc/fail2ban/jail.d/dovecot.conf

[dovecot]
enabled=true

Nginx