cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Curl using STARTTLS even if mailserver does not support it?

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Wed, 20 Feb 2013 15:12:26 +0000

Hi Volker,

On Wed, 20 Feb 2013, Volker Schmid wrote:

> I initiate it using curl_easy_setopt with CURLOPT_USE_SSL
> = CURLUSESSL_TRY. I assume that it should use STARTTLS
> only if the mailserver replies to support it. But this
> happens at some customer:

Curl currently sends the STARTTLS command regardless of whether the server
supports it or not.

However, I have recently added support for honouring the STARTTLS capability
which as of the next release curl will only send STARTTLS if the server
advertises it in the EHLO response.

> I can not see any reason why CURL should use STARTTLS
> and obviously it fails. But should CURL not use standard
> AUTH-LOGIN in this case?

As you are using CURLUSESSL_TRY I would have expected you to receive the 554
error, as you did, and then curl should have continued with AUTH-LOGIN if
username and password information was supplied.

> 2013-02-20 14:36:14 : CURL: MAIL FROM:<xxxxxxxxxxx_at_fr.company.com>
> 2013-02-20 14:36:14 : CURL: Recv failure: Connection was aborted
> 2013-02-20 14:36:14 : CURL: Send failure: Connection was aborted
> 2013-02-20 14:36:14 : CURL: Closing connection #0

From the log you supplied it looks like the username and password wasn't
supplied, so curl treated the connection as anonymous, continued with the
MAIL FROM command and then failed as it couldn't receive a response to that
command.

Does this happen all the time and if so are you able to debug it?

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-02-20