cURL cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] Re: #1456 Curl SMTP client CRLF and dot stuffing doesn't work

From: Steve Holme <captain-caveman_at_users.sf.net>
Date: Sat, 29 Nov 2014 00:05:19 +0000

Just a quick update...

I don't build against libcurl for use in an application at home but instead build curl so my testing tonight has been a little different from yours.

I used the following command line:

-v -ssl -k smtp://smtp.example.com -T C:\curl\mail-lf.txt --crlf --mail-rcpt recipient_at_example.org --mail-from sender_at_example.org

Whilst debugging transfer.c and smtp.c I can see my strings are as follows (I have removed the headers and body separator for clarity):

As read from my file:

".The body of the message starts here.\n.\nIt could be a lot of lines, could be MIME encoded, whatever.\nCheck RFC5322.\n.\n"

After LF to CRLF conversion:

".The body of the message starts here.\r\n.\r\nIt could be a lot of lines, could be MIME encoded, whatever.\r\nCheck RFC5322.\r\n.\r\n"

After calling Curl_smtp_escape_eob() to do the dot stuffing:

"..The body of the message starts here.\r\n..\r\nIt could be a lot of lines, could be MIME encoded, whatever.\r\nCheck RFC5322.\r\n..\r\n"

Do you have the same issues if you use curl?

Kind Regards

Steve

---
** [bugs:#1456] Curl SMTP client CRLF and dot stuffing doesn't work**
**Status:** open-confirmed
**Labels:** smtp 
**Created:** Tue Nov 25, 2014 03:35 PM UTC by bra
**Last Updated:** Fri Nov 28, 2014 11:13 AM UTC
**Owner:** Steve Holme
Hi,
I'm trying to send a simple e-mail with curl. SMTP has two caveats here: dot stuffing and CRLF, I've tried to test these in my sample e-mail.
This is the code, which is mostly the smtp example from curl source:
http://pastebin.com/0JtwGTqx
For the options, I've just added curl_easy_setopt(curl, CURLOPT_CRLF, 1L); to do CRLF conversions, and replaced \r\n in payload_text to see whether it works or not.
Bug #1: this example sends LF line endings on the wire, so my SMTP server refuses the e-mail. Shouldn't CURLOPT_CRLF convert them to CRLF?
Bug #2: dot stuffing doesn't happen. The lines with a dot in the first character aren't get prepended with an extra dot, so the transaction here fails (because of the lone LF.LF). If think an SMTP client should do this and not let the client take care of it.
Could you please investigate these?
Thanks,
$ curl -V
curl 7.39.0 (amd64-portbld-freebsd10.0) libcurl/7.39.0 OpenSSL/1.0.1i zlib/1.2.8
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: AsynchDNS Largefile GSS-API SPNEGO NTLM NTLM_WB SSL libz TLS-SRP
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-11-29

These mail archives are generated by hypermail.