Bug in parsing MSG

Hi,
When loading MSG or converting MSGtoEML, I’m getting bad/wrong info, such as Date or From - for some messages:

The From header is NOT rendered at all, while it should be:
se******@outlook.com

Date is rendered as below:
Date: Mon, 01 Jan 0001 00:00:00 -0500

Expected to be:
Date: Sat, 01 Oct 2022 05:19:30 -0400

Code being used:
Dim AsposeMessage As Email.MailMessage = Email.MailMessage.Load(EmailPath, LoadOptionsMSG)
AsposeMessage.Save(MyMemoryStream, SaveOptionsEML)

MSG file sample:
FailureANSI.zip (182.9 KB)

@australian.dev.nerds

Could you please share the save and load options that you are using?

Sure,

LoadOptionsMSG
DecodeClearSignedContent = True
DecodeSignedContent = True
KeepOriginalEmailAddresses = True
PrefferedTextEncoding = Nothing
PreserveEmbeddedMessageFormat = True
PreserveTnefAttachments = False

SaveOptionsEML
CheckBodyContentEncoding = True
PreserveEmbeddedMessageFormat = True
PreserveSignedContent = True

If setting different save and load options will cause the wrong headers to be rendered, that will be a tragedy

.MSG saves sender and recipients in two places - Internet headers and separate properties. Usually, they match. Sometimes, they don’t.

If the .MSG message doesn’t have Internet headers at all (i.e. it’s a draft which has never been sent), it won’t have Internet headers anyway and From/To/CC/BCC must be obtained from their designated properties only

The same way, if the .MSG message does have Internet headers but doesn’t have From/To/CC/BCC in separate properties, only values from Internet headers must be returned

If both exists, and don’t match, no idea, but this current state is not correct.

unfortunately this also happens to storage readers as well, I think the other problem I’ve reported while reading some messages from OST/PST file with blank From/To inside some folders like DRAFTS, is related to this.

Please forward the notes to the developers in charge.

@australian.dev.nerds

We have logged this problem in our issue tracking system as EMAILNET-40756. We will inform you once there is an update available on it. We apologize for your inconvenience.

@australian.dev.nerds

We have fixed issue with Date: header. The fix will be available in the next version of Aspose.Email i.e. 22.10.

The issue with From: header cannot be fixed because source file is Draft of message and does not contain any info about sender.

Hi
Thanks, you mean in case if source is not a draft, it will have it?

@australian.dev.nerds

Yes, your understanding is correct.

1 Like