Jump to content

How to check if your Server provider is blocking SMTP Port 25

Featured Replies

Posted

In this tutorial we’ll check if SMTP port 25 is open for email sending out via Telnet on your Linux machine. Today most of the cloud provider disable the SMTP port 25 to prevent spamming issues. Remember Port 25 is needed to send emails out if it is closed you can’t send email out of the server via any ports despite it is open for you.

Here are the steps to check the SMTP port:

Open the Terminal or ssh on your server.

Type the following command to install telnet if it’s not already installed:

For centos/EL :-

yum install telnet


or for ubuntu/debian :-

apt install telnet


Type the following command and press Enter:

telnet server.alphagnu.com 25


use server.alphagnu.com hostname for better results or replace it with remote server ip or hostname

If the port is open, you will see a message like this:

[root@server]# telnet server.alphagnu.com 25
Trying 5.161.42.110...
Connected to server.alphagnu.com.
Escape character is '^]'.
220 server.alphagnu.com


This means that the SMTP port 25 is open and you can send emails.

If the port is closed or you cannot connect to the SMTP server, you will see an error message like this after 3-5 minutes of waiting:

[root@cwp ~]# telnet server.alphagnu.com 25
Trying 5.161.42.110...
telnet: connect to address 5.161.42.110: Connection timed out
Trying 2a01:4ff:f0:a15::1...
telnet: connect to address 2a01:4ff:f0:a15::1: Network is unreachable


This means that the SMTP port 25 is closed or there is a network restriction and preventing the connection.

If the port is closed, you may need to check your firewall settings or contact your network administrator to troubleshoot the problem.

  • 5 months later...

i like to use 

netstat -tulpn | grep LISTEN
$ netstat -tulpn | more

netstat -tulpn | grep LISTEN
netstat -tulpn | more

to check if there is a service running on that portm then do the telnet debug.

Create an account or sign in to comment