cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: SMTP+SSL fails with curl_multi_perform

From: Alona Rossen <arossen_at_opentext.com>
Date: Thu, 4 Nov 2010 10:07:17 -0400

On Wed, 3 Nov 2010, Alona Rossen wrote:

(please don't write your mails below the signature divider "-- ",
mailers such
as mine will strip off the signature on replies which makes it hard for
me to
quote your mails!)

> This is a failure with multi_perform():

>>>Ok, then we need to up the game as that code, when converted to plain
C and
>>>adapted to my conditions, worked flawlessly for me several times!

>>>You (and anyone else) can get my version of the test code as I've now

>>>committed and pushed it:

         http://curl.haxx.se/libcurl/c/smtp-multi.html

>>>What SSL library do you use?

>>>My verbose output looks like this (mind that I run a debug build with
slightly
>>>more text). I've only used my current dev version in my tests but
nothing
>>>particular have changed in the SMTP code recently.

>>>* 0x9e3d8fc is at send pipe head!
>>>* STATE: CONNECT => WAITRESOLVE handle 0x9e5770c; (connection #0)
>>>* About to connect() to smtp.gmail.com port 587 (#0)
>>>* Trying 74.125.77.109... * STATE: WAITRESOLVE => WAITCONNECT
handle
>>>0x9e5770c; (connection #0)
>>>* Connected to smtp.gmail.com (74.125.77.109) port 587 (#0)
>>>* SMTP 0x9e57c44 state change from STOP to SERVERGREET
>>>* STATE: WAITCONNECT => PROTOCONNECT handle 0x9e5770c; (connection
#0)
>>>< 220 mx.google.com ESMTP b52sm7539641eei.7
>>>> EHLO sture
>>>* SMTP 0x9e57c44 state change from SERVERGREET to EHLO
>>>< 250-mx.google.com at your service, [82.182.26.5]
>>>< 250-SIZE 35651584
>>>< 250-8BITMIME
>>>< 250-STARTTLS
>>>< 250 ENHANCEDSTATUSCODES
>>>> STARTTLS
>>>* SMTP 0x9e57c44 state change from EHLO to STARTTLS
>>>< 220 2.0.0 Ready to start TLS
>>>* successfully set certificate verify locations:
>>>* CAfile: /etc/ssl/certs/ca-certificates.crt
>>> CApath: none
>>>* SSL connection using RC4-MD5
>>>* Server certificate:
>>>* subject: C=US; ST=California; L=Mountain View; O=Google Inc;
>>>CN=smtp.gmail.com
>>>* start date: 2010-04-22 20:02:45 GMT
>>>* expire date: 2011-04-22 20:12:45 GMT
>>>* issuer: C=US; O=Google Inc; CN=Google Internet Authority
>>>* SSL certificate verify ok.
>>>> EHLO [edited out]
>>>* SMTP 0x9e57c44 state change from STARTTLS to EHLO
>>>< 250-mx.google.com at your service, [82.182.26.5]
>>>< 250-SIZE 35651584
>>>< 250-8BITMIME
>>>< 250-AUTH LOGIN PLAIN XOAUTH
>>>< 250 ENHANCEDSTATUSCODES
>>>> AUTH PLAIN [edited out]
>>>* SMTP 0x9e57c44 state change from EHLO to AUTH
>>>< 235 2.7.0 Accepted
>>>* SMTP 0x9e57c44 state change from AUTH to STOP
>>>* STATE: PROTOCONNECT => DO handle 0x9e5770c; (connection #0)
>>>* DO phase starts
>>>> MAIL FROM:<[edited out]>
>>>* SMTP 0x9e57c44 state change from STOP to MAIL
>>>* STATE: DO => DOING handle 0x9e5770c; (connection #0)
>>>< 250 2.1.0 OK b52sm7539641eei.7
>>>> RCPT TO:<[edited out]>
>>>* SMTP 0x9e57c44 state change from MAIL to RCPT
>>>< 250 2.1.5 OK b52sm7539641eei.7
>>>> DATA
>>>* SMTP 0x9e57c44 state change from RCPT to DATA
>>>< 354 Go ahead b52sm7539641eei.7
>>>* SMTP 0x9e57c44 state change from DATA to STOP
>>>* DO phase is complete
>>>* STATE: DOING => DO_DONE handle 0x9e5770c; (connection #0)
>>>* STATE: DO_DONE => WAITPERFORM handle 0x9e5770c; (connection #0)
>>>* STATE: WAITPERFORM => PERFORM handle 0x9e5770c; (connection #0)
>>>* STATE: PERFORM => DONE handle 0x9e5770c; (connection #0)
>>>* SMTP 0x9e57c44 state change from STOP to POSTDATA
>>>< 250 2.0.0 OK 1288862222 b52sm7539641eei.7
>>>* SMTP 0x9e57c44 state change from POSTDATA to STOP
>>>* Connection #0 to host smtp.gmail.com left intact
>>>* Expire cleared

>>>$ ./src/curl -V
>>>curl 7.21.3-DEV (i686-pc-linux-gnu) libcurl/7.21.3-DEV OpenSSL/0.9.8o

>>>zlib/1.2.3.4 c-ares/1.7.4-DEV libidn/1.18 libssh2/1.2.8_DEV
librtmp/2.2e
>>>Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps
pop3
>>>pop3s rtmp rtsp scp sftp smtp smtps telnet tftp
>>>Features: AsynchDNS Debug TrackMemory GSS-Negotiate IDN IPv6
Largefile NTLM
>>>SSL libz

In my case a certificate was not provided. This is an obvious
difference. Do you have a signed certificate that can be accepted by
gmail?
We use ssl 0.9.8. I was able to reproduce the issue on Windows and
Solaris.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-04