We need to add a rule that would block/drop all outgoing mail except destined for certain mail servers. What is the best way to do this? Still new to MT, but learning lots!
Eric
/ip firewall filter
add chain=forward action=accept protocol=tcp dst-port=25 dst-address-list=mail_servers in-interface=LAN
add chain=forward action=drop protocol=tcp dst-port=25 in-interface=LAN
destination of the email message is inside the message. filtering based on that can only be done if you are the SMTP server that sends it. not possible on RouterOSDestined to certain servers. We just want to drop everything that isn't meant for our specific mail servers.
We changed out our core router for MT. With our previous router, we had it setup so that it would drop Bots and Worms that were being sent out by infected client computers. So if emails were sent out from client machines that used any email servers other than ours they were dropped.destination of the email message is inside the message. filtering based on that can only be done if you are the SMTP server that sends it. not possible on RouterOSDestined to certain servers. We just want to drop everything that isn't meant for our specific mail servers.
/ip firewall filter
add chain=forward protocol=tcp port=25 connection-state=new dst-address=!xx.xx.xx.xx action=drop
Thanks for the quick reply, how do I add the list of email servers that are ok to send to?You want to block any new connections from your localnet clients to other email servers than yours for outbound email? This should do:Replace xx.xx.xx.xx with your email sever ip.Code: Select all/ip firewall filter add chain=forward protocol=tcp port=25 connection-state=new dst-address=!xx.xx.xx.xx action=drop
/ip firewall address-list
add list=OK-smtp address=1.1.1.1
add list=OK-smtp address=2.2.2.2
/ip firewall filter
add chain=forward protocol=tcp port=25 connection-state=new dst-address=!OK-smtp action=drop
/ip firewall filter
add chain=forward protocol=tcp port=25 connection-state=new dst-address-list=email action=accept
add chain=forward protocol=tcp port=25 connection-state=new action=drop
/ip firewall address-list
add address=xx.xx.xx.xx list=email
Make an address list enumerating all the servers and use the line Tim gave you with a slight modification to check the address list rather than the destination address directly:
Completely missed that you weren't trying to block content, just destination.Code: Select all/ip firewall address-list add list=OK-smtp address=1.1.1.1 add list=OK-smtp address=2.2.2.2 /ip firewall filter add chain=forward protocol=tcp port=25 connection-state=new dst-address=!OK-smtp action=drop