Critical Bug in Message.Save

Hello,
Please kindly run my sample, a sample OLM is included, the test project will pick it and save its first item in an mbox rd storage, as well as in .eml format.
Check the saved files, pretty invalid!
Thank you.
WindowsApplication3.zip (3.8 MB)

@australian.dev.nerds,

I’m sorry, but I don’t see a bug here. Converting a VCF contact to an EML email message is not a direct conversion process since these are different file formats and serve different purposes. However, we can create an email message and attach the VCF contact to it. That’s exactly what Aspose.Email did.

1 Like

Hello,
Sorry but that’s not a VCF contact, it’s an MapiMessage with IPM.Contact class!
I’m loading MapiContact to MapiMessage
Items inside a personal storage (pst;ost;olm) are all MapiMessages?

@australian.dev.nerds,

Yes, in MAPI the contact is MapiMessage because it has the same structure.
But how are you going to translate it to MailMessage and still keep all the fields of the contact? Because there are no special fields in eml where contact properties can be stored. So the only way out is to convert MapiMessage to vcf, and add it to eml.

Please kindly let me see, if the source is pst;ost extracting contact to MapiMessage and
MapiMessage.Save (“eml.eml”, EmlSaveOptions)
works for pst;ost
but not for olm?!!!

Also, saving calendar items from olm using the same method works fine! Just not contact?!

And also, even if it is that way, saving MapiMessage as MailMessage with EmlSaveOptions at worst should populate a blank email, not an eml with deformed vcf source, as Eml?!

@australian.dev.nerds,

  1. In the current example, you disabled PreserveTnefAttachment (ASPSaveSetEML.FileCompatibilityMode = FileCompatibilityMode.PreserveTnefAttachments commented out). Therefore, there is no place to store contact properties except in vcf. To illustrate this, I have save the contact as Tnef eml. Just open the contact_tnef.eml in Outlook in 1.zip (1.1 KB).

  2. Outlook and other email clients have built-in support for iCalendar files (specified by the “text/calendar” Content-Type), which allow them to parse and display the calendar information in a user-friendly way. On the other hand, Outlook is not designed to be displayed eml with vCard (specified by the “text/vcard” Content-Type) in the same way as a calendar. To illustrate this, I have attached 2.zip (746 Bytes) that contains two files: event.eml and contact.eml. Just open them in Outlook and compare. Then compare them in any text editor and you will see that both files have a similar structure.