What is posted there is not a script. It is a set of filter rules and address lists that will drop tcp traffic that goes over port 25 (most often SMTP) if it violates certain limits that usually identify it as spamy behavior. If you had problems with the specific rules you would either need to adjust them or disable them.
These are the specific rules that we use on our networks and they work, but if you are protecting a server at a central location and not a specific network, you will need a different approach. In either case if you have a SMTP relay server, you will want to have some form of spam filtering on the server to protect the server and prevent yourself from being black listed.
Hi, just struggling with the same problem. We have own smtp server (ClearOs Linux), but it is not reliable (if it would broke, my brother would not be able to repair it himself, and I am not always available at hand), so that server is not a problem. But then we have users, who request that e.g. gmail (plus cca 8 other well known services) being used, so we have an address list of “allowed_mail_servers”, where users have to authenticate, so we allow that.
But - then we are allowed to use our ISPs mail server. I tried to set-up some rules, but so far I am not sure it works reliably:
do all viruses/spam malware behave the way, that it opens multiple connections? I mean - is it possible to open one tcp connection to smtp server, and deliver multiple emails? Because if so, then the connection-limit rule might not catch all spam techniques
limit= 50, 5 - OK, so I limit by 50 pps. Is that reliable? I mean - 50 packets, even of 1400bytes size = ~ 70 KB of data. So - is 70KB of data delivered per second any good measure for the technique to work reliably?
I can see that with newer OSes (I am not working with MT so frequently, so sorry if it is in there for ages ), there is so called dst-limit. My question is - could I use the rule, instead of setting limit + connection limit? Is that the same? I mean - could following rule be used instead?:
of course you can deliver mail to several people with one connection: list more than one person in the To and CC fields
no, that is not reliable. Malware can adapt and ensure to send less than any given rate
Spam is not something you deal with on a router. Spam is something you deal with on a mail server, be it the actual mail servers involved in the email chain or a proxy transparently inserted. To efficiently deal with spam you need something that inherently understands mail on the application layer.