Email Setup Center
  • Home »
  • Linux Server SMTP Configuration

How To Check SMTP Configuration In Linux?

On this web page, we’ll show you how to check SMTP configuration in Linux using the Telnet, and ncat protocols.

If you haven’t installed any of the protocols mentioned above, then first install it. To install the Telnet protocol on Linux, open the Terminal window and run the below mentioned command in it.

  • sudo yum install telnet

Installing ncat or nc:

In order to install the ncat protocol, run the sudo yum install nmap-ncat -y command in the terminal window.

how to check SMTP configuration in Linux

Method 1: Checking the SMTP connection using the Telnet

  • While checking the SMTP configuration in Linux usually, the SMTP servers use ports such as 25, 2525, and 587 for communications.
  • Now, on the Terminal window, type the following command:
  • telnet [your hostname] [port no] 
  • Here, replace “your hostname” with the name of your host and “port no” with your smtp server ports.
  • Tap the Enter button.
  • Now, your SMTP server configuration details and the status will be displayed on the screen.
  • To exit Telnet, press the Ctrl and ] buttons.

Method 2: Checking the SMTP connection using Ncat or Nc

  • In the Terminal window, run the following command:
  • nc -v -u smtp.example.com port_no
  • If your SMTP connection status is connected, then you can see the following commands, that help to check SMTP configuration in Linux:
  • [root@xxxxx auth]# ncat -v -u smtp.domain.com port
  • Ncat: Version x.xx ( https://nmap.org/ncat )
  • Ncat: Connected to xxx.xxx.xx.xx:xxx
  • If it is not connected, you will see the commands mentioned below.
  • [root@xxxxx auth]# ncat -v -u smtp.domain.com port
  • Ncat: Version 7.50 ( https://nmap.org/ncat )
  • Ncat: Could not resolve hostname "smtp.xxxx.com": Name or service not known. QUITTING.

To get remote assistance on checking SMTP configuration in Linux , contact us.