PersonalStorage AddMessage Issue

Hello,
There’s an issue when I load a signed eml via MapiMessage and add it to the PersonalStorage.
It will be corrupt in the pst in 2 ways:

  1. Signature is lost
  2. Source eml has html and plain text part, while target pst will not have its html part
    Sample to reproduce:
    WindowsApplication2.zip (29.7 KB)
    Thanks

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): EMAILNET-40948

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

Hello and another query about the possibility of this preventing bug to get a fix in 23.5? :slight_smile:

Hi @australian.dev.nerds
This issue is still under investigation.

Hi @australian.dev.nerds
When loading from eml to MapiMessage, preserve the signature is not supported by default. Use the following code to preserve the signature:

        MailMessage msg = MailMessage.Load(fileName);
        MapiConversionOptions opt = new MapiConversionOptions();
        opt.PreserveSignature = true;
        MapiMessage mapi = MapiMessage.FromMailMessage(msg, opt);
1 Like

Hello and thanks for the tip, I have objections though! Because the case is marked as Resolved and won’t give a fix! I think the logic is not right.

You have used MapiMessage.FromMailMessage, but we should be able to use MapiMessage.Load too, while EmlLoadOptions does not have PreserveSignature.

I said we should be able to use MapiMessage.Load because support gave me that code in some cases, so do you think this internal signature preserve should be enabled by default internally?

OR if you do not agree, please specify the differences between MapiMessage.FromMailMessage and MapiMessage.Load in help files, so developers know when to use which one!

Anyway, this MapiMessage.FromMailMessage is the one pending for input stream support, do you have any news if this will be out in 23.5? :slight_smile:
Thank you :slight_smile:

The ticket was marked as Resolved with resolution “Code snippet provided”

We do not want to include PreserveSignature in EmlLoadOptions so as not to confuse the user when loading messages from eml to MailMessage.

Inside Aspose.Email dll MapiMessage.Load calls MapiMessage.FromMailMessage with default MapiConversionOptions

I have no information about will be included this feature in 23.5

Hello,
Thank you this information was pretty important, I really appreciate it, if you don’t mind may I ask 3 more quick questions?

  1. Can you please confirm for which message types this will occur?
    I guess when we call MapiMessage.Load with EmlLoadOptions + EmlxLoadOptions + MhtmlLoadOptions this will happen, am I right?

  2. No idea about AppointmentLoadOptions

  3. And vise versa, what happens when we call MailMessage.Load with MsgLoadOptions + TnefLoadOptions, the reverse will happen or not?
    Best :slight_smile:

MapiMessage.Load with EmlLoadOptions + EmlxLoadOptions + MhtmlLoadOptions +HtmlLoadOptions

I did not understand this case, clarification needed.

When loading msg in MailMessage, on the contrary, preserve the signature is supported by default and decoded if DecodeSignedContent is true. This opposite behavior may seem strange, but the addition of these settings was at the request of users, and they were different…
TnefLoadOptions does not have a setting for working with signatures, the signature is saved by default

1 Like

Hello,
Sorry but I need to ask for your reconsideration.

This bug or misbehavior or whatever you call it, does not happen only when AddMessage to PST.
When converting Eml to Msg, this will also happen:

MapiMessage = MapiMessage.Load(source, EmlLoadOptions)
MapiMessage.Save(target, MsgSaveOptions)

If you try to convert a signed/encrypted message using the above code, you will see the same result, blank body!

The reason for my insist to fix it internally?
Many many places on the docs, forum and my own support tickets, Aspose advised the above!
So all your users are suffering from this.

Personally, to get rid of this, I will never use MapiMessage to load anything but Msg/Oft/Tnef
So not my direct problem anymore, just wanted to let you know.
Thanks :slight_smile:

Bad, a case with no workaround, kindly run this sample and declare why MapiMessage.Body/BodyHtml/BodyRtf are all blank?

MyMapiMessage.Decrypt will not make a change!

WindowsApplication1.zip (4.2 MB)

We know this, because while adding to PST MailMessage always converts to MapiMesage

Thanks for this test case, I will check it.

1 Like

Thanks, forget about Add MailMessage to PST, I meant for simple email conversion tasks, from Eml to Msg this will also happen:
MapiMessage = MapiMessage.Load(source, EmlLoadOptions)
MapiMessage.Save(target, MsgSaveOptions)

No where mentioned that this will break the signed/encrypted messages, very nice that you knew it :slight_smile:

Hello @australian.dev.nerds,

You’re right, the only way to fix this inconsistency is to keep the signature/encryption by default.

So, I created the EMAILNET-41070 task to fix this.

Thank you, and sorry for the inconvenience.

1 Like

Hello and thank you very much for this great improvement approval.

Just, this case was in connection with MapiMessage issue?
I mean after fixing the EMAILNET-41070 this issue will also be fixed?

Further, PersonalStorage: SaveMessageToStream and ExtractMessage both don’t have SaveOptions.
Just asking about their differences?
ie one might behave differently with signed/encrypted or any other type of messages?
Can you please share their differences?
Best :slight_smile:

Hello @australian.dev.nerds,

Yes, I think it will. But I can’t exactly answer that question now. We’ll see, as we work on fixing the problem.

All MAPI properties are extracted from the pst without changes, there should be no difference, I think.

1 Like

Hello,
Sorry, the problem/bug seems to exist also in MailMessage class, just run this sample plz:
WindowsApplication2.zip (3.8 MB)

Hello @australian.dev.nerds,

Thank you, I have added this sample + problem description to EMAILNET-40942.