Telnet smtp.mail - must issue STARTTLS command first

8-Bit Borges picture 8-Bit Borges · Sep 19, 2015 · Viewed 24.6k times · Source

On my Mac terminal, I am trying to telnet into my smtp.gmail.com through port 587.

On Google Apps, (which is set to manage a Dreamhost domain), I have relay configured, as follows:

"Allowed senders: Only addresses in my domains" "Require SMTP Authentication: Yes"

when I HELO <[email protected]>, I get:

250 smtp.gmail.com at your service

then I enter MAIL FROM: <[email protected]>

which returns:

530 5.7.0 Must issue a STARTTLS command first.

what am I doing wrong?

Answer

Matthias Wimmer picture Matthias Wimmer · Sep 19, 2015

You're required to start encrypting the connection first. This is done using the STARTTLS command.

You can use the following command instead of telnet:

openssl s_client -starttls smtp -connect smtp.gmail.com:587

It works like the telnet command, but takes care of starting the encryption first.