Connecting the world…

AUTH

SMTP Auth testing via CLI

Just a quick note to describe the procedure for SMTP auth testing via the command-line. At first you need to encode username and password in Base64. This can be done in several ways. The easiest way would be via https://www.base64encode.org/.

Next you can use the following commando’s via telnet to test SMTP AUTH. I always use OpenSSL to connect to the mail server. OpenSSL give you the option to connect to the mail server using STARTTLS.

1) Connect to the mail server

openssl s_client -starttls smtp -crlf -connect smtp.office365.com:25

2) Send the EHLO command to see which items the server supports

EHLO ME
250-VI1PR0101CA0034.outlook.office365.com Hello [93.95.250.230]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH LOGIN
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

3) Start SMTP AUTH

AUTH LOGIN
334 VXNlcm5hbWU6

4) The 334 command tells you to enter the Base64 username. When the correct username is entered, the server responses with “334 UGFzc3dvcmQ6”.
5) Enter the Base64 password. The server responses with a successful or unsuccessful message.

235 2.7.0 Authentication successful target host VI1PR06MB1198.eurprd06.prod.outlook.com

6) Now enter the default command’s to send a mail.

MAIL FROM:<from@domain.com>
RCPT TO:<rcpt-to@domain.com>
DATA
SUBJECT: this is the subject

This is the body of the message
.