Community discussions

MikroTik App
 
Spirch
Member Candidate
Member Candidate
Topic Author
Posts: 119
Joined: Sat May 03, 2014 5:04 am

restrict how many email a specific ip can send

Mon May 31, 2021 7:33 pm

i don't know if this is possible.

situation:
i have a device that i have no control over it
in general it behave properly, just the proper amount of email. Port 587 is open for that ip to allow sending email.

problem:
sometime it start sending multiple email per minutes for no reason whatsoever, for now I'm stuck with this thing, i can't fix or disconnect it.
the extra email are useless and not harmful, just annoying like hell

so, question;
how would you limit it to a maximum of 1 email per 3 minutes
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11968
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: restrict how many email a specific ip can send  [SOLVED]

Mon May 31, 2021 7:45 pm

Limit to 1 connection over 3 min, but you do not have any warranty if connect send dozen email within same sesssion


on firewall fiter, if are matched src-ip add src-ip to drop-list for 3 min
make one previous rule block that list

done.

supposing the IP of the device are 100.70.40.10
/ip firewall filter
add action=drop chain=forward src-address-list=drop_this_list
add action=add-src-to-address-list address-list=drop_this_list address-list-timeout=3m chain=forward dst-port=25,587 protocol=tcp src-address=100.70.40.10
 
Spirch
Member Candidate
Member Candidate
Topic Author
Posts: 119
Joined: Sat May 03, 2014 5:04 am

Re: restrict how many email a specific ip can send

Mon May 31, 2021 7:57 pm

Limit to 1 connection over 3 min, but you do not have any warranty if connect send dozen email within same sesssion


on firewall fiter, if are matched src-ip add src-ip to drop-list for 3 min
make one previous rule block that list

done.

supposing the IP of the device are 100.70.40.10
/ip firewall filter
add action=drop chain=forward src-address-list=drop_this_list
add action=add-src-to-address-list address-list=drop_this_list address-list-timeout=3m chain=forward dst-port=25,587 protocol=tcp src-address=100.70.40.10
thanks! that was fast!

i will try later today and get back here with the result
 
User avatar
jvanhambelgium
Forum Veteran
Forum Veteran
Posts: 985
Joined: Thu Jul 14, 2016 9:29 pm
Location: Belgium

Re: restrict how many email a specific ip can send

Mon May 31, 2021 9:54 pm

If you are an ISP you'd better deploy you own mail-relay for your customers where you have a huge amount of tweaks & controls.
Trying to solve this with at the level of a Mikrotik device with TCP-connections management is like trying to solve a Rubik's cube with a baseball bat.

Loads of fun no doubt, but ... ;-)
 
Spirch
Member Candidate
Member Candidate
Topic Author
Posts: 119
Joined: Sat May 03, 2014 5:04 am

Re: restrict how many email a specific ip can send

Tue Jun 01, 2021 1:45 am

sometime the easiest solution is the proper one, first few hours with that simple filter rules seem to work

i though it would need something way more complex

thanks again!

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], holvoetn, karlisi and 87 guests