Error decoding email.

Giganews Newsgroups
Subject: Error decoding email.
Posted by:  Charles (charlesl…@hotmail.com)
Date: Fri, 28 Mar 2008

Hi,
  I am using Indy 10 with .NET 1.1.  The issue i'm facing is that some of the email i'm receiving are being decoded incorrectly.  I have compared the email with those that are correctly decoded and the only difference that i could find was due to Content-type.  Body Messagepart is being decoded as AttachmentFile even though the Content-disposition is not attachment.

It seems that Indy 10 is doing a case sensitive check for the header segment.
In messages where the header is "Content-Type", it works fine.
In messages where the header is "Content-type", it works incorrectly.

The .NET code fragment is below.

For Each mp As MessagePart In msg.MessageParts
  If mp.GetType() Is GetType(Indy.Sockets.AttachmentFile) Then

      Dim att As AttachmentFile
      att = CType(mp, AttachmentFile)

      .............
  End if
next

Sample provided below

Content-type: multipart/mixed; boundary="Boundary_(ID_5laWjxXmcYVA9VDF0JIq9Q)"
X-OriginalArrivalTime: 27 Mar 2008 23:49:14.0715 (UTC)
FILETIME=[29C852B0:01C89065]

This is a multi-part message in MIME format

--Boundary_(ID_5laWjxXmcYVA9VDF0JIq9Q)
Content-type: text/plain
Content-transfer-encoding: 7BIT

BODY CONTENT COMES HERE

--Boundary_(ID_5laWjxXmcYVA9VDF0JIq9Q)
Content-type: application/octet-stream; name=fwb.txt
Content-transfer-encoding: base64
Content-disposition: attachment; filename=fwb.txt

RldCDQpLRUJORQ0KRldCLzEwDQoxODAtMTg5NTU0NDBCTkVVTE4vVDFLMTQwDQpSVEcvSUNOS0UN
ClNIUA0KL0FERyBHTE9CQUwgU1VQUExZIFBUWSBMVEQNCi8xNiBPWExFSUdIIERSSVZFDQovTUFM
QUdBL1dBDQovQVUvNjA5MA0KQ05FDQovTUFKh1IgRFJJTExJTkcgTU9OR09MSUEgTExDDQovQ0hJ
TkdHSVMgQVZFTlVFIFNVS0hFQkFBVEFSIERdU1RSSUMNCi9VTEFBTkJBQVRBUiAgIDEzDQovTU4N
CkFHVC8vMDIzNTU2Mi80MTQzDQovQ0FSRedNCi9CTkUNCkFDQy9HRU4vQUFLVFlKM0FODQpDVkQv

--Boundary_(ID_5laWjxXmcYVA9VDF0JIq9Q)--

Replies