1

I am trying to send mail from terminal using openssl by connecting to gmail's server using ssl on the port 465. Things are fine until i enter from address and authenticate. But when i enter RCPT TO, i get the following error.

RCPT TO: <abc@gmail.com>
RENEGOTIATING
139815845389984:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:596:

I can guess out that the problem might be due to missing security certificates. Can someone please help me solve the problem?

muru
  • 207,228

1 Answers1

3

You are using the openssl s_client program which is for testing purposes only. The capital R letter has a special meaning in openssl s_client (see man s_client), it triggers a renegotiation as you can see.

Solution: SMTP accepts lowercase commands too, so use lowercase r as in:

rcpt to: <some@example.com>

Alternative solution: use GnuTLS instead of OpenSSL as a SSL/TLS client:

gnutls-cli -p 465 smtp.gmail.com
Lekensteyn
  • 178,446