s_client doesn't like pipes

2013-02-22 Thread Andreas Mattheiss
Sorry, but the mailing list program has eaten more than half of my
rant. Looks like it doesn't like a dot on it's own on a line (Yes, I
know it's the SMTP signal for EOT).


Hi,

I was monkeying around a bit with s_client. Idea is to feed s_client a
file with commands required to STARTTLS, authenticate to the smtp server
and the message itself. I have this file:

--
ehlo hereami
auth login
dfbdffdbZWhhcjU=
dffdddBoYTI=
mail from:
rcpt to:
data
From: 
To: 
Subject: With s_client
Date: Mon, 18 Feb 2013 22:28:00 +0100

Testing ...
one-single-dot
QUIT
---

Without the dashes, of course; plus real addresses and passwords.

I then do openssl s_client -crlf -connect smtp.gmail.com:587 -CApath
 /etc/mutt_CA -starttls smtp -pause -quiet < feed

gmail then comes back with


depth=2 /C=US/O=Equifax/OU=Equifax Secure Certificate Authority verify
return:1
depth=1 /C=US/O=Google Inc/CN=Google Internet Authority verify return:1
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
verify return:1
250 ENHANCEDSTATUSCODES
250-mx.google.com at your service, [91.44.157.56] 250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH XOAUTH2
250 ENHANCEDSTATUSCODES
334 VXNlcm5hbWU6

and that's it, nothing more. Won't take any more interactive input either.
The 334 VXNlcm5hbWU6 is begging for the user name, but apparently it
doesn't get one. Now comes the funny thing: leaving out the ehlo line in
the file gives me

depth=2 /C=US/O=Equifax/OU=Equifax Secure Certificate Authority verify
return:1
depth=1 /C=US/O=Google Inc/CN=Google Internet Authority verify return:1
depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com
verify return:1
250 ENHANCEDSTATUSCODES
334 VXNlcm5hbWU6
334 UGFzc3dvcmQ6

Final words are now 334 UGFzc3dvcmQ6 which means it's awaiting the
password.

The thought would arise that somehow s_client for whatever reason only
gets the first two lines from the external file. Typing the commands
interactively wotks ok.

I tired all sorts of other things, like leaving out -pause etc, but to no
avail. Anybody has any clues, please ("bug or feature")?

TIA, regards
Andreas
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


Re: s_client doesn't like pipes

2013-02-21 Thread Jeffrey Walton
On Wed, Feb 20, 2013 at 4:10 PM, Andreas Mattheiss
 wrote:
>
> s_client doesn't like pipes
This works well for me:

  $ echo "GET / HTTP1.0" | openssl s_client -connect example.com:443

It looks like you need something more like a response file.

Jeff
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org


s_client doesn't like pipes

2013-02-21 Thread Andreas Mattheiss
Hi,

I was monkeying around a bit with s_client. Idea is to feed s_client a
file with commands required to STARTTLS, authenticate to the smtp server
and the message itself. I have this file:

--
ehlo hereami
auth login
dfbdffdbZWhhcjU=
dffdddBoYTI=
mail from:
rcpt to:
data
From: 
To: 
Subject: With s_client
Date: Mon, 18 Feb 2013 22:28:00 +0100

Testing ...
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   majord...@openssl.org