MIME Encoding error with IdMessage.SaveToFile

Giganews Newsgroups
Subject: MIME Encoding error with IdMessage.SaveToFile
Posted by:  Mike Simons (michael_simo…@hotmail.com)
Date: Thu, 1 Jan 2004

Using the MessageSaveLoad demo, (that comes with Indy for D7) I encountered
a few problems with trying to load and save a message to a file.

Using the attached emails, it is possible to recreate my problems using the
current development snapshot for Indy 9.

Problem 1:

When loading the "before" e-mail, the Body is blank after reading.  This
appears to be due to the fact that this email (generated using Outlook 2000)
contains no MIME boundary for the message containing only simple text.  I
found a "solution" to the problem in a post to your SMTP newsgroup by Ander
Pietsch from August 4, 2003 which suggests commenting out the line "if
MIMEBoundary <> "" then begin" in IdMessageDecodeMIME but that's probably
not the best solution to the problem.

Problem 2:

When saving the message back to a file after making the above change, the
included "after" email is produced.  The problem being the header
information still includes "Content-Transfer-Encoding: base64" but the
message body has been saved as plain text.  This produces jibberish when
attempting to reload the file.

Any ideas?

Replies