curl-library
Re: SMTP, data corruption and dot stuffing
Date: Wed, 19 Oct 2011 23:45:07 +0200
Le 19/10/2011 22:18, Daniel Stenberg a écrit :
> On Wed, 19 Oct 2011, operaxxox_at_yahoo.ca wrote:
>
>> You can find the source here : http://pastebin.com/8gQtUZLZ
>
> Lovely, I'll use this to figure out what you're experiencing!
>
>> I do not expect a dot before B, I'm not sending one I'm sending a
>> <CR><LF>
>
> As you already figured out, it isn't a dot. It is the newline. If
> you do 'config.trace_ascii = 0;' you'll see it in the hexdump output.
>
> The problem is that the carriage return ('\r') is stripped off. I
> don't know why yet.
Yes, the dot is actually a line feed :
3ff0: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 AAAAAAAAAAAAAAA
=> Send data, 0000000002 bytes (0x00000002)
0000: 0a 42 .B
<= Recv header, 0000000055 bytes (0x00000037)
I've made a complete and real example of the bug.
This message (http://pastebin.com/9iC5sduj) is sent with this code
(http://pastebin.com/HuzM96w7).
The message contains a .jpeg, you can open the message with a mail
reader like thunderbird if you save it with an .eml extension. The
.jpeg sha1 is b82bb67cb895675c6096ec194cc8239a01848108
When the message is received, the .jpeg sha1 is now
da694446d4907ce9b25dadcc7ca2c631339027a2
You can see the received message here : http://pastebin.com/mMKvNkVA
-- Catherine ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2011-10-19