How to check mail server settings by sending a test message in command line?

Created:

2016-11-16 12:39:25 UTC

Modified:

2017-08-16 16:45:11 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to check mail server settings by sending a test message in command line?

Applicable to:

  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Symptoms

It is necessary to check mail server settings by sending a test message in command line.

Cause

Mail server configuration is corrupted and troubleshooting is needed.

Resolution

  1. telnet to 25 port using instructions from this KB article (skip auth login part if SASL authentication is not enabled):

  2. 213373249 SMTP authorization does not work with Postfix MTA: "SASL login authentication failed".

  3. Use OpenSSL:

    # openssl s_client -starttls smtp -crlf -connect example.com:587

In this case if encrypted connection (TLS) is being tested, encrypt username and password in the following way:

# echo "name@example.com" |openssl enc -base64
# echo "password" |openssl enc -base64

Example output after you use the openssl command:

# openssl s_client -starttls smtp -crlf -connect example.com:587

250 DSN
auth login
334 VXNlcm5hbWU6
dGzdBhcFFmAbm9ZGjcJvdGVRMu2g=
334 UGFzc3dvcmQ6
MfOcXhjYrpiouyBtrDytrl
235 2.7.0 Authentication successful
mail from:test@example.com
250 2.1.0 Ok
rcpt to:test2@example2.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Test
.
250 2.0.0 Ok: queued as BA5941E962
quit
221 2.0.0 Bye
closed
Have more questions? Submit a request
Please sign in to leave a comment.