cURL / Mailing Lists / curl-library / Single Mail

curl-library

SMTP connection re-use possible?

From: Volker Schmid <volker.schmid_at_regify.com>
Date: Fri, 30 Nov 2012 17:25:23 +0100

Hello,

I'm trying to reuse STARTTLS SMTP connections or simple SMTP connections for sending emails. Sadly, I do not get it to work.

Here is how it looks for GMX:

CURL: About to connect() to mail.gmx.net port 25 (#0)
CURL: Trying 213.165.64.20...
CURL: connected
CURL: Connected to mail.gmx.net (213.165.64.20) port 25 (#0)
CURL: 220 mail.gmx.net GMX Mailservices ESMTP {mp037}
CURL: EHLO Volker-PC
CURL: 250-mail.gmx.net GMX Mailservices
CURL: 250-8BITMIME
CURL: 250-ENHANCEDSTATUSCODES
CURL: 250-SIZE
CURL: 250-AUTH=LOGIN PLAIN
CURL: 250-AUTH LOGIN PLAIN
CURL: 250-STARTTLS
CURL: 250 STARTTLS
CURL: STARTTLS
CURL: 220 2.7.0 Ready to start TLS {mp028}
CURL: successfully set certificate verify locations:
CURL: CAfile: cacert.pem
   CApath: none
CURL: SSLv3, TLS handshake, Client hello (1):
CURL: 
CURL: SSLv3, TLS handshake, Server hello (2):
CURL: 
CURL: SSLv3, TLS handshake, CERT (11):
CURL:
CURL: SSLv3, TLS handshake, Server key exchange (12):
CURL:
CURL: SSLv3, TLS handshake, Server finished (14):
CURL: 
CURL: SSLv3, TLS handshake, Client key exchange (16):
CURL: 
CURL: SSLv3, TLS change cipher, Client hello (1):
CURL: 
CURL: SSLv3, TLS handshake, Finished (20):
CURL: 
CURL: SSLv3, TLS change cipher, Client hello (1):
CURL: 
CURL: SSLv3, TLS handshake, Finished (20):
CURL: 
CURL: SSL connection using DHE-RSA-AES256-SHA
CURL: Server certificate:
CURL: subject: C=DE; ST=Bayern; L=Muenchen; O=1&1 Mail & Media GmbH; OU=GMX; CN=mail.gmx.net
CURL: start date: 2011-10-04 00:00:00 GMT
CURL: expire date: 2013-10-03 23:59:59 GMT
CURL: common name: mail.gmx.net (matched)
CURL: issuer: C=US; O=Thawte, Inc.; CN=Thawte SSL CA
CURL: SSL certificate verify ok.
CURL: EHLO Volker-PC
CURL: 250-mail.gmx.net GMX Mailservices
CURL: 250-8BITMIME
CURL: 250-ENHANCEDSTATUSCODES
CURL: 250-SIZE
CURL: 250-AUTH=LOGIN PLAIN
CURL: 250-AUTH LOGIN PLAIN
CURL: 250 STARTTLS
CURL: AUTH PLAIN xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CURL: 235 2.7.0 Go ahead {mp028}
CURL: MAIL FROM:alice.master_at_xxxxxxxxx.de
CURL: 250 2.1.0 ok {mp028}
CURL: RCPT TO:<dummy_at_xxxxxxxxxx.de>
CURL: 250 2.1.5 ok {mp028}
CURL: DATA
CURL: 354 mail.gmx.net Go ahead {mp028}
CURL: X-Mailer: mySMTPAgent
To: dummy_at_xxxxxxxxxxx.de
From: Alice Master <alice.master_at_xxxxxxxxxxxxxxx.de>
Reply-To: alice.master_at_xxxxxxxxxxx.de
Date: Fri, 30 Nov 2012 17:16:45 +0100
Subject: Multiuse test dummy_at_xxxxxxxxxxxxx.de
MIME-Version: 1.0
Message-Id: <rgfGXKGUTJCAULBSCRDAOYOLRSWGLILSMGXPBrgf_at_www.xxxxxxxxxxxxxx.com>
Content-Type: multipart/mixed; boundary="20a61edeeeba3fc4f9c502c1689994f3"

--20a61edeeeba3fc4f9c502c1689994f3
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html><b>This</b> is the <h1>body</h1>...</html>
(... snip ...)
CURL: --20a61edeeeba3fc4f9c502c1689994f3--
.
CURL: 250 2.6.0 Message accepted {mp028}
CURL: Connection #0 to host mail.gmx.net left intact
--------------------------------------------------------------------------
CURL: Re-using existing connection! (#0) with host mail.gmx.net
CURL: Connected to mail.gmx.net (213.165.64.20) port 25 (#0)
CURL: MAIL FROM:alice.master_at_xxxxxxxx.de
CURL: 502 5.5.2 Unimplemented {mp028}
CURL: Access denied: 502
CURL: QUIT
CURL: 502 5.5.2 Unimplemented {mp028}
CURL: Closing connection #0
CURL: SSLv3, TLS alert, Client hello (1):
CURL: 
CURL: Login denied
CURL_SendMail: Error performing GET. Curl ec:67

For Domainfactory it returns
CURL: 500 command unrecognised
instead of 502 Unimplemented

I never made it ro reuse some SMTP connection. Is this not possible at all?

Volker
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-30