cURL / Mailing Lists / curl-users / Single Mail

curl-users

SOLUTION TO: curl-smtp-gmail commandline example, please?

From: Sune Ahlgren <sune_ahlgren_at_hotmail.com>
Date: Wed, 13 Oct 2010 13:39:10 +0200

Hi,

finally I found what was wrong.

Two parts where I give some friendly pointers (SUMMARY) and a walk through of my steps (STEPS TAKEN).

Thanks for a neat library!
/Sune

SUMMARY
==========
a)
You should warn people about port 25, why it works for you I don't know, I have to use 587. If you don't like spam to originate from your part of Bredbandbolagets network you should probably warn them and have them block it. As I said, in my part of the network it seems blocked, refer to the 'STEPS TAKEN' section below.

b)
At the end of the configure step, I think it would be good with a warning saying: 'No SSL/TLS support included', see why in the next section c) and an alternative to this printout. Again, refer to the 'STEPS TAKEN' section below.

c)
curl should not accept an --ssl argument and it shouldn't give a STARTTLS command if it does not support SSL/TLS. It seems it knows that it doesn't, given it's graceful exit after the '220 2.0.0 Ready to start TLS' response from the smtp server. see below.

STEPS TAKEN

==========
1)
I use debian and SMTP is not included in the standard package so I built my own.

2)
I then used the command you provided 2 days ago:

curl smtp://smtp.gmail.com -v
   -T mailtest (using your example mail basically)
   --mail-from '<my-full-gmail-address>' (the <> letters are necessary!)
   --mail-rcpt '<daniel_at_haxx.se>' (you might want another address)
   --ssl (gmail requires it)
   -u [my gmail user]:[my gmail password] (full user withouth @gmail.com)

3)
This gave me nothing but silence, but when I changed to port 587 of the smtp server at
least I got this in Wireshark:

220 mx.google.com ESMTP x54sm4463564eeh.5

EHLO brakare.txt

250-mx.google.com at your service, [85.229.96.125]

250-SIZE 35651584

250-8BITMIME

250-STARTTLS

250 ENHANCEDSTATUSCODES

STARTTLS

220 2.0.0 Ready to start TLS

QUIT

4)
This shows that curl shut down gracefully at the beginning of the TLS/ssl part.

5)
An ldd on my curl binary showed me no libcrypto.so and no libssl.so which would be expected.
After poking around I found the debian package libcurl4-openssl-dev and I installed it and
this made things work!!!

                                               

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-10-13