Anbei eine kleine aber schöne Ergänzung, dadurch kann man die Anzahl an Treffer pro Virus- oder Spam-Mail verändern:
Erstellt unter filter.d/ einmal eine amavis-spam.conf:
Code: Alles auswählen
# Fail2Ban configuration file
[Definition]
# Option: failregex
failregex = (.*) Blocked SPAM, \[<HOST>\]
# Option: ignoreregex
ignoreregex =
und dann noch eine amavis-virus.conf:
Code: Alles auswählen
# Fail2Ban configuration file
[Definition]
# Option: failregex
failregex = (.*) Blocked INFECTED (.*), \[<HOST>\]
# Option: ignoreregex
ignoreregex =
Danach brauchen wir zwei statt einer neuen Section in jail.conf:
Code: Alles auswählen
[Amavis-Spam]
enabled = true
filter = amavis-spam
action = iptables[name=amavis, port=25, protocol=tcp]
sendmail-whois-lines[name=amavis, dest=fail2ban@blocklist.de, sender=fail2ban@DEINE-DOMAIN, logpath=%(logpath)s]
logpath = /var/log/mail.log
maxretry = 3
[Amavis-Virus]
enabled = true
filter = amavis-virus
action = iptables[name=amavis, port=25, protocol=tcp]
sendmail-whois-lines[name=amavis, dest=fail2ban@blocklist.de, sender=fail2ban@DEINE-DOMAIN, logpath=%(logpath)s]
logpath = /var/log/mail.log
maxretry = 1
Durch diese Konfig wird schon bei einer Virus Mail ein Report erstellt aber bei Spam müssen es hier mindestens 3 Mails sein.