Question/Suggestion :: Signed/Encrypted

Hello,
I’ve got a question or suggestion: when using EnumerateMessages to read Pst/Ost or Olm storages:

Email.Storage.Pst.MessageInfo
Email.Storage.Olm.OlmMessageInfo

How to get Message .IsEncrypted and .IsSigned properties?

  • Without extracting full message, I’m looping in a huge storage and just getting From/To/Subject fields.
    So if possible, just wanna get those 2 mentioned properties as well.

** If it’s not possible, may I ask for a feature request case?
Thanks.

@australian.dev.nerds

We have logged this requirement in our issue tracking system as EMAILNET-40768. We will inform you once there is an update available on it.

Hello and sorry for the inconvenience, please add a note to include:
MessageInfo.HasAttachments
OlmMessageInfo.HasAttachments
If the above 2 is not possible or too much?

@australian.dev.nerds

We have logged it in our issue tracking system.

Hello,
I think MessageInfo.Properties can be used to get PST HasAttachments by reading MSGFLAG_HASATTACH ?
And for IsSigned and IsEncrypted or generally IsSecure/ IsSmime any flags?

OlmMessageInfo already got HasAttachments (whished MessageInfo also had it)
Anyway for OlmMessageInfo.IsSigned IsEncrypted IsSecure/IsSmime there’s no way, not critical, since OlmMessageInfo already can’t read signed / encrypted messages! :slight_smile:

Hello @australian.dev.nerds,

Unfortunately, there are no such flags. The only way is MessageClass property + checking the extracted message.

1 Like

Hello
Please kindly advise how to get MSGFLAG_HASATTACH property from MessageInfo ?
In paralel, how do you think about adding MessageInfo.HasAttachments to get the above property?
OlmMessageInfo already got .HasAttachments property.

Yep, but the problem is an ancient old bug in OlmMessageInfo which return IPM.Note for all Messages, even for signed/encrypted ones which should be IPM.Note.SMIME or IPM.Note.SMIME.MultipartSigned

Also, OlmMessageInfo will be NULL for signed/encrypted messages Subject / From etc fields…

@australian.dev.nerds,

Try the following code:

' Load the Outlook PST file
Dim pst = PersonalStorage.FromFile("sample.pst")

' Get the folders and messages information
Dim folderInfo = pst.RootFolder.GetSubFolder("Inbox")

For Each messageInfo In folderInfo.EnumerateMessages()
    Dim flags = CType(messageInfo.Properties(KnownPropertyList.MessageFlags.Tag).GetLong(), MapiMessageFlags)

    If (flags And MapiMessageFlags.MSGFLAG_HASATTACH) Is MapiMessageFlags.MSGFLAG_HASATTACH Then
        ' has  attach
    End If
Next

This request already added to the EMAILNET-40768 ticket

In answering your question earlier, I meant MessageInfo from pst, not olm. As you know, the structure of pst and olm is very different. In pst MessageInfo is a real structure and it has a limited set of properties. If we add these IsSecure/ IsSmime properties, it can significantly reduce the performance of creating a MessageInfo object. In olm a performance will be better, but there are other issues that come to the fore.
In any case, all requests to add IsSecure/ IsSmime properties are registered, and we will consider them anyway.

1 Like

Hello and thank you very much for your detailed info,

I don’t need PersonalStorage and OlmReader MessageInfo / OlmMessageInfo properties to detect secure messages (IsSigned / IsEncrypted / IsSmime / IsSecure) anymore, not worth the performance reduction.

I meant OlmMessageInfo.MessageClass will be wrong for signed / encrypted message, it will be IPM.Note which is for non-secure messages.

Additionally, when using OlmMessageInfo it will return null / string empty for most properties like Subject / From etc… when on a secure message!

@australian.dev.nerds,

I see. We will consider this issue while working on the EMAILNET-40768.