Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Date: 2013feb19 Product: Postfix, fail2ban Q. How can I avoid the annoying spam attempts away from my Postfix logs? A. You can use fail2ban to stop an IP-address from contacting you after a few spamming attempts. Install fail2ban:dnf install fail2banEnsure you have /etc/fail2ban/filter.d/postfix.conf If you don't put this in there:[Definition] failregex = reject: RCPT from (.*)\[<HOST>\]: 554Add this to /etc/fail2ban/jail.conf[postfix] enabled = true filter = postfix action = iptables-multiport[name=postfix, port="smtp,submission", protocol=tcp] logpath = /var/log/postfix maxretry = 3Start fail2bansystemctl start fail2banLook at the iptables changes:iptables -LClear iptables stuff and restart fail2ban:iptables -F systemctl restart fail2banAlso handy for ssh, dovecot, ftpd, etc
Add a commentSign in to add a comment