2
votes

I am receiving emails from an Exchange server using the Indy TIdIMAP4 component's UIDRetrieve() function under Delphi XE with the Indy components version 10.5.7.

This normally works fine, though sometimes the message is cut off at a dot followed by a line break. This happens when the dot is exactly at column 76.

Example: I call IMAPConnection.UIDRetrieve(1, Email); with email 1 having the following body:

The message's text will be cut off at the dot at column 76, so exactly here.
This text won't be accessible via TIdMessage.

What I then receive when I call Email.Body.Text is this:

The message's text will be cut off at the dot at column 76, so exactly here

So the second sentence is not available in Email. When I access the message body via telnet it looks like this:

The message's text will be cut off at the dot at column 76, so exactly here=
.
This text won't be accessible via TIdMessage.

This also happens when I have a multipart message and I access the message part body via TIdText(MsgPart).Body.Text. In this case also any message attachments are not retrieved.

Is there any property I have to set or function I have to call on my IMAP connection or the message object to avoid this?

Sebastian

1
Bizarre. I don't know much about Indy, so no answer, but I'll give you an upvote. - David
A period on a line by itself is what signifies the end of a message in SMTP — perhaps IMAP, too? If so, then in looks to me like the server is mis-encoding the message before it sends it to your client. - Rob Kennedy
No, imap uses a size prefix, not dots - Max
IMAP does not use SMTP dot transparency, but Indy's implementation of IMAP does. This was a bug in older versions, and was finally addressed not too long ago. - Remy Lebeau

1 Answers

3
votes

Your version of Indy is outdated. You need to upgrade. This issue was already addressed in TIdIMAP4 back in December 2012 in SVN rev 4883. The current version in Indy's SVN is 10.6.0 rev 5022.