I have an IP that I’m repeatedly getting spam from. I added it to iptables like this:
iptables -I INPUT -s xxx.xxx.xxx.xxx -j DROP
This successfully seems to block any communication coming from that IP address (including their emails), but the setting doesn’t survive a reboot. Any other recommended method to explicitly prevent an IP from sending emails to my domain?
I read multiple community topics and Github notes and couldn’t get a clear answer what the current best way to do this is.
@phildar that worked and survived a reboot! Thanks so much. Hopefully that other discussion I sent you was of use. Thanks for chiming in and helping with this.
Update: Adding the ufw rule to deny held fine after a reboot but that remote junk mail server was still able to connect and I received an email from them. It seems I needed to reorder my ufw rules to putting that deny at the top. I followed the instructions found here.