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
  • 193,181
  • 53
  • 473
  • 722
  • Could it have something to do with [POODLE](http://askubuntu.com/questions/537196/how-do-i-patch-workaround-sslv3-poodle-vulnerability-cve-2014-3566) and SSLv3? – muru Oct 21 '14 at 12:13
  • @muru i am a newbie to smtp/ssl and so i am not that sure of what the problem is! – Aarish Ramesh Oct 21 '14 at 12:16

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
  • 171,743
  • 65
  • 311
  • 401