bertjohnson / OpaqueMail

.NET email library and proxy supporting IMAP, POP3, and SMTP with S/MIME and PGP.
https://opaquemail.org
Other
92 stars 35 forks source link

bug in DecompressRTF (TnefEncoding.cs) #2

Closed pan-tau closed 10 years ago

pan-tau commented 10 years ago

Hi,

i found out the value of variable:

string rtfPreBufferString = "{\rtf1\ansi\mac\deff0\deftab720{\fonttbl;}{\f0\fnil \froman \fswiss \fmodern \fscript \fdecor MS Sans SerifSymbolArialTimes New RomanCourier{\colortbl\red0\green0\blue0\n\r\par \pard\plain\f0\fs20\b\i\u\tab\tx";

is wrong, based on documentation for RTF (link) the sequence should contain CRLF sequence, which is \r\n not \n\r like in your variable

i found this while i was coding tnef parser based on your implementation in c++. This causes that the newlines are broken in the RTF body string. (empty lines are added to the string when viewed under debugger).

It probably isn't a big issue, i just thought you might care :)

http://www.google.sk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&ved=0CC4QFjAB&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F5%2FD%2FD%2F5DD33FDF-91F5-496D-9884-0A0B0EE698BB%2F%5BMS-OXRTFCP%5D.pdf&ei=anBeUrTmE8fPsgaPwIC4Dw&usg=AFQjCNENgk1bu0jgIz-XX_hIetFOCCt5jg&bvm=bv.54176721,d.Yms

bertjohnson commented 10 years ago

Thanks Pan-Tau, good catch. That fix is now implemented and checked in.