Talking TLS to SMTP

I recently wanted to test TLS with SMTP. I followed instructions on and got it to work in less than 30s ;-)

In short:

perl -MMIME::Base64 -e 'print encode_base64("\000user\000password")'
openssl s_client -starttls smtp -crlf -connect <ip>:<port>
auth <auth_command>
mail from:<tadek@pietraszek.org>
rcpt to:<tadek@pietraszek.org>
data
...
.

Interestingly, when I tried typing `RCPT` s_client would interpret it as “renegotiate”, which confused me a bit, but you can inhibit it with `–quiet` or type it in lowercase like I did ;-)

T.

3 Responses to “Talking TLS to SMTP”

  1. Andreas Schiermeier Says:

    Hi Tadek,

    do you know swaks http://jetmore.org/john/code/#swaks?

    Kind regards,
    Schiermi

  2. tadekp Says:

    Cool. And it also has a Debian package. Nice tip!

  3. Facebook Says:

    very good tip thank you.

Leave a Reply