Site Map


Port 25 Blocked?

So you've managed to get a mail server running on your computer at home, and set up DNS information for your domain.  You can telnet and ftp to your computer, and maybe HTTP works too... but not mail.  Chances are your ISP is blocking incoming connections on port 25 (the standard SMTP port).

There are a few things to check first, though:

  • First, try connecting to your SMTP server from the same computer.  Try the localhost address first: "telnet 25" usually does the trick (replace "25" with a different port number if you're trying to set up SMTP service on an alternate port).  If that works, your server is indeed up and running, and the next step is to try your assigned IP address (still from the same machine): "telnet your-IP-here 25".  Note that if you're behind a broadband router, your IP address is assigned by the router itself and is not the same as the IP assigned to the router by your ISP.  If this works then your server is listening on the correct ports and addresses.  If not, the problem is somewhere in your configuration: consult the docs for your mail server to figure out what's wrong.
  • The next step is to find a machine outside of your home network, and preferably outside of your ISP's network as well.  Then try that telnet command again: "telnet your-external-IP-address 25".  Note that in this case the IP address is the one assigned to you by your ISP and not the "internal" address you might have if you have a home network behind a broadband router.  If you can't find an external machine to test from, you can take a look at my links page and use one of the sites in the "debugging tools" section.
  • If you can connect to your mail server from outside your ISP's network, then you're all set: you've configured things correctly and your ISP doesn't block port 25 (at least for incoming connections).  If it didn't work, there is still one thing to check: if your server is behind a broadband router, make sure that connections on the appropriate port are being forwarded to the correct internal computer.  Consult your router documentation for assistance.
  • If you're verified that your SMTP server is reachable from within your own network but not from outside, then chances are good that your ISP has deliberately blocked connections on port 25.

So how do I work around a port block?

If your ISP blocks port 25 you can always attempt to convince them that they're being antisocial and that they should unblock that port, at least for you.  My experience is that you aren't likely to get very far.

The other alternative is to run your SMTP server on a different port.  This is fairly simple to do with most SMTP software; consult the documentation for yours to figure out exactly how it's done.  Commonly used alternate ports are 2525 and 25025, but you can use any valid (and unused) port number.  Once you've configured your server to listen on a different port, run through the tests above again, using your new port number instead of 25.  If all goes well, you should be able to verify that not only is your server running on the new port, it's reachable from outside your ISP's network, too.

That's the easy part.  Unfortunately, there's no way to tell the rest of the world what port your SMTP server is listening on.  The DNS system allows you to list the servers that will accept mail for your domain (using MX records), but those servers are then assumed to be listening on port 25.  Attempting to add port information to your MX records (by using "", for example) will only cause strange error messages to be returned to people who try to send you mail.

The only way to receive mail on a non-standard port is to arrange for someone else's servers to receive it for you first (on the standard port) and then forward it to you on the non-standard port you've chosen.  Then you list only those other servers as MX hosts for your domain.  This way the only servers that need to know that you're running on a non-standard port are yours and the ones you publish in your MX records.

This is exactly the situation I found myself in.  At the time I couldn't find anyone else willing to act as an MX host and forward my mail to me on an alternate port.  As a result, I wound up buying and colocating my own servers to do this job.  While it's a neat hobby, it is a bit on the expensive side....

If you're in this situation and are looking for a service that will accept your mail and forward it to you, was created with you in mind. Head back to the main page and see how it works.

Copyright © 2002-2010
Scott Logan