Block Unwanted Email Recommendations
So I have a company that I've registered my email address with and sadly they wont unsubscribe me. I've tried over and over and they tell me they don't recognize my email address but clearly they're sending me promotional messages daily. I'm running Postfix 2.7.1 on my mail server and would like to know what's the best recommended way to block them? Should I block them by IP or should I block them via domain name? Obviously the domain is easily forged so I am guessing a range or specific IP would be the best, no?
Below are headers: Code:
Return-Path: <bounce@returnpath.bluehornet.com> |
This isn't a postfix solution, but it will block the emails:
iptables -I INPUT -s 67.216.225.254 -p tcp --dport 25 -j REJECT That will reject any incoming traffic from that IP on port 25. You'll want to put it in your startup scripts to re-add the rule after reboots. |
Thanks - that was voted as "helpful" but I'm only looking for Postfix specific solutions.
|
Postfix has a "check_sender_access" feature which can accomplish this. From the postfix.org documentation site:
Quote:
Here is a link to some detailed instructions. You may also see recommendations for performing this action with spamassassin. This can work as you can create a custom black list which will add 100 points to mail from that recipient, causing spamassassin to flag it. The postfix solution is more direct as it will return an error code at the SMTP level. Undoubtedly you want to avoid 'bouncing' the mail which would undoubtedly be futile, but they may get the message (no pun intended) if your smtp returns a hard error code. One thing I recall that postfix does by default and you may want to look into this is that it will let them complete a decent portion of the mail transaction and then issue the reject error. I read about this is postfix the definitive guide. I think the reason was to prevent them from knowing what you were filtering on to help prevent them from working around it. One other thing, you may also be able to implement restrictions in the ehlo portion of the transaction. Just something else to look into. |
All times are GMT -5. The time now is 08:26 PM. |