problem with ConvertPreamble in Indy 10

Giganews Newsgroups
Subject: problem with ConvertPreamble in Indy 10
Posted by:  JN (die…@gmx.de)
Date: Mon, 21 Jun 2004

Hi,

there is the following problem in indy 10 (latest dev-snapshot) with EMail
without MessageParts:

1.) this mail was created with Tobit Infocenter and received with
Indy-Test-Application

To: xxx
From: xxx
Subject: test text tobit 222
Message-ID: xxx
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7Bit

testtesttesttesttesttesttesttesttesttesttesttesttest

.

----------------------------------------------------------------------------
--------------------------
2.) after the first call of TIdMessage.SaveToStream the Stream-Content looks
like this:

To: xxx
From: xxx
Subject: test text tobit 222
Message-ID: xxx
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7Bit

This is a multi-part message in MIME format

--VplQKywYqeimpZpJOLZi3naU=_KfSaea6r
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

testtesttesttesttesttesttesttesttesttesttesttesttest

--VplQKywYqeimpZpJOLZi3naU=_KfSaea6r--

.

Indy converts the BodyText in a TIdText-Attachment but don't insert the
Boundary
in the ContentType of the Mailheader - so that this mail is now corrupted !
The problem here is that TIdMessage.GenerateHeaders don't add a Boundary to
the Content-Type Header if MessagePart.Count is 0, but
TIdMessageClient.SendBody
generates a TIdText-Part from the Bodytext (if ConvertPreamble is set to
TRUE and
MessagePart.Count is 0).
In the result we have 1 MessagePart but it couldn't be found from any
Parser, because
the MailHeader contains no Boundary !!!

----------------------------------------------------------------------------
--------------------------
3.) from the second call of TIdMessage.SaveToStream the Stream-content looks
like this:

To: xxx
From: xxx
Subject: test text tobit 222
Message-ID: xxx
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1";
boundary="VplQKywYqeimpZpJOLZi3naU=_KfSaea6r"
Content-Transfer-Encoding: 7Bit

testtesttesttesttesttesttesttesttesttesttesttesttest

--VplQKywYqeimpZpJOLZi3naU=_KfSaea6r
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

testtesttesttesttesttesttesttesttesttesttesttesttest

--VplQKywYqeimpZpJOLZi3naU=_KfSaea6r--

.

Couldn't find any reason for that problem  ...

Replies