cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: SMTP functionality with authentication fails!

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 3 Dec 2012 23:40:04 +0100 (CET)

On Mon, 3 Dec 2012, Steve Holme wrote:

> What would normally happen when using smtp://, in non-proxy mode, is that
> libcurl would connect to gmail, issue the EHLO, their server would respond
> with the 250 status lines and then libcurl should send STARTTLS to start the
> TLS upgrade. Once the upgrade is complete, libcurl will issue another EHLO,
> gmail will respond with similar 250 status lines but this time include the
> allowed AUTH mechanisms thus allowing libcurl to authenticate and continue
> normally.
>
> I hope Daniel will be able to shed some light here, as I have no real
> "programming" experience with sending data through a proxy server - and it
> has been a few years since I even set one up (if you include Microsoft's
> TMG!).

The fact that it went through a proxy to reach the server doesn't really
change anything in regards to SMTP here. It is by all means normal SMTP.

> What I don't know is if libcurl supports TLS upgraded connections through a
> proxy server - if it does then you might have found a bug in the SMTP module
> :(

It does. The proxy connection is transparent (to most parts of the code) and
it should be able to upgrade that to TLS if there's a need. Since libcurl
gives up here without trying it makes me suspect that possibly this libcurl
was built without SSL support. Wouldn't that basically have this effect? (If
so, we should probably consider adding some logging saying so...)

> Additionally, rather than try a TLS upgraded connection have you tried using
> smtps:// to see if that works? Here libcurl should try and create an SSL
> connection using port 465 - again I don't know if this works through a
> proxy.

It should, but since an unencrypted connect worked we can be pretty sure an
unconditional TLS handshake on the same port won't!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-12-03