Emails can not be sent or received by the mail server due to ports limitations
Symptoms
Emails can not be sent or received by the mail server in ispmanager 6.
Causes
Limitations on the mail server ports.
For the mail server to work correctly, ports 110, 143, 993, 995, 587, 465 and 25 must be available on the server.
Use the telnet and nmap utilities to check if the ports are available for connection.
Telnet check
Using the telnet utility, it is possible to check port availability from a remote machine by executing the command:
telnet <ip address> <port>
For example, to check the availability of inbound connections (port 110) on the mail server at 172.31.97.58, run the following command:
telnet 172.31.97.58 110
If the port connection to the server is available, the command will output the following:
Trying 172.31.97.58...
Connected to 172.31.97.58.
Escape character is '^]'.
+OK Dovecot (Ubuntu) ready
If the port connection is unavailable, the command will return an error: «Unable to connect to remote host: Connection refused».
To check the availability of outbound connections, run a command on your server. For example:
telnet smtp.gmail.com 25
If the connection is successful, the command output will be the following:
Trying 142.251.1.109...
Connected to smtp.gmail.com.
Escape character is '^]'.
220 smtp.gmail.com ESMTP 2adb3069b0e04-52fd5c2931asm880471e87.240 - gsmtp
If the port connection is unavailable, the command will return an error: «Network is unreachable».
The address smtp.gmail.com can be used to check ports 25 and 465. To check the availability of ports 143 and 993, use the address imap.gmail.com.
Nmap check
Using the nmap utility, it is possible to check port availability from a remote machine by running the command:
nmap <ip address> -p<port>
For example, to check the availability of inbound connections (port 110) on the mail server at 172.31.97.58, run the following command:
nmap 172.31.97.58 -p110
If the port connection to the server is available, the command output will show the open status (column STATE):
Starting Nmap 7.80 ( https://nmap.org ) at 2024-01-01 11:11 MSK
Nmap scan report for isptest.ru (172.31.97.58)
Host is up (0.014s latency).
PORT STATE SERVICE
110/tcp open pop3
Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds
The filtered status indicates that the port connection is restricted from the server side. The closed status indicates that the port is not listened to by the service or port connection is restricted at the network level from the server side.
Additionally, the -Pn key, which is specified instead of a specific port, can be used to check the status of all listening ports:
$ nmap 172.31.97.58 -Pn
Starting Nmap 7.80 ( https://nmap.org ) at 2024-01-01 11:11 MSK
Nmap scan report for isptest.ru (172.31.97.58)
Host is up (0.071s latency).
Not shown: 982 closed tcp ports (conn-refused)
PORT STATE SERVICE
21/tcp filtered ftp
22/tcp filtered ssh
25/tcp open smtp
53/tcp open domain
80/tcp open http
110/tcp open pop3
111/tcp open rpcbind
143/tcp open imap
443/tcp open https
465/tcp open smtps
587/tcp open submission
873/tcp open rsync
993/tcp open imaps
995/tcp open pop3s
1100/tcp filtered mctp
1500/tcp open vlsi-lm
3306/tcp open mysql
5432/tcp open postgresql
Windows does not include the nmap utility as a standard feature. It can be installed from the official website.