Can I safely block port 25 on my server?
October 26, 2007 12:55 AM
Subscribe
Can I block port 25 or not?
I'm working on the firewall of a public facing webserver at the moment, and want to block TCP port 25 (SMTP) to incoming traffic as I'm seeing many connections that I just don't want to accept. The server does not handle any incoming email so this would usually be a no-brainer, just block and forget about it.
However, the server is sending around 25000 emails to a distribution list, two or three times a week. I am sure that AOL, or some other big email providers will block emails coming from servers that do not have port 25 open.
I don't want to just block it to test this and have a load of failed emails to deal with.
Do you know if I need to leave port 25 open or not?
posted by ajbattrick to computers & internet (5 comments total)
3 users marked this as a favorite
You can avoid the overhead of firewalling, if you're not already doing it, just by having your mail program listen only on the loopback. Inbound connection attempts will get an instant REFUSED; this takes almost no CPU time. If you're running a firewall, each and every packet has to be inspected by the firewall engine, which will reduce server performance somewhat.
If you're going to run a firewall anyway, then blocking inbound 25 is fine. You shouldn't even need an explicit block rule, just don't accept that traffic. You are using deny all by default, right? Trying to identify and block bad packets is a waste of time. Classify and allow only good ones, and drop everything else.
You may also want to do the 'listen' thing above, just in case the firewall gets shut off or that code is somehow compromised. Defense in depth. Firewalls are just one of many layers of netting you should have up to catch the bad guys.
posted by Malor at 1:48 AM on October 26, 2007