You can get different kinds of filters for Fail2ban which work for instance with Apache, Dovecot, Postfix and SSH.