Hello,
I have a question regarding the best way to handle an incomming relay spammer on my mail server. I am looking for a way to dynamically block incomming traffic on port 25 based on some logic.
Let me explain. The spammer does not achieve his relay actions through the mail server that is not the issue. Also, I have IPBan running so once they come in, the IP is banned for a few months indefinitaly. So that is handled. The issue is that they are using hosts all over the world so atm I have blocked about 30 countries through Skynet and the volume is dramatically less, so all good.
The issue however is 3 fold:
1. I hate blocking all these countries. I feel its a canon to kill an anoying fly
2. Log file size is going through the roof
3. When the spammer throws his mails onto the mailserver, its always in a block of a 100 mails and my mailsever doesn't have a setting to block it
So, my idea was to have some sort of script running that checks incomming connections on port 25 and then checks wether the next x amount of incomming requests are from the same IP on the same port and then add it dynamically to the ip tables. That way it doesn't even get onto the mailserver and just bounces of the firewall.
I have been looking in scripts and entware and I'm sure this can be done. Installing a script would not be an issue. Making it would, as I have 0 expirience in making such scripts. I have been writing code for the last 40 years, but never on unix. So I guess I could find it after a lot of trial and error. So if any1 has something a like, or something I can use as a basis, it would be appriciated.
Maybe there is a better idea to get this done.
Eather way, already many thanks for any ideas.
I have a question regarding the best way to handle an incomming relay spammer on my mail server. I am looking for a way to dynamically block incomming traffic on port 25 based on some logic.
Let me explain. The spammer does not achieve his relay actions through the mail server that is not the issue. Also, I have IPBan running so once they come in, the IP is banned for a few months indefinitaly. So that is handled. The issue is that they are using hosts all over the world so atm I have blocked about 30 countries through Skynet and the volume is dramatically less, so all good.
The issue however is 3 fold:
1. I hate blocking all these countries. I feel its a canon to kill an anoying fly
2. Log file size is going through the roof
3. When the spammer throws his mails onto the mailserver, its always in a block of a 100 mails and my mailsever doesn't have a setting to block it
So, my idea was to have some sort of script running that checks incomming connections on port 25 and then checks wether the next x amount of incomming requests are from the same IP on the same port and then add it dynamically to the ip tables. That way it doesn't even get onto the mailserver and just bounces of the firewall.
I have been looking in scripts and entware and I'm sure this can be done. Installing a script would not be an issue. Making it would, as I have 0 expirience in making such scripts. I have been writing code for the last 40 years, but never on unix. So I guess I could find it after a lot of trial and error. So if any1 has something a like, or something I can use as a basis, it would be appriciated.
Maybe there is a better idea to get this done.
Eather way, already many thanks for any ideas.
Last edited: