How to Tag a mail with a blue arrow when forwarding it via MimeContent
Hello,
I'm trying to forward an e-mail via MS Graph. But since I have to decrypt the Mail before forwarding it, I thought the best solutions would be to send the Mime Content
of the message in order to forward it. I've been following official Microsoft the docs to forward a Message and I am forwarding the message like this:
StringContent stringContent = new(base64String, Encoding.UTF8, MediaTypeNames.Text.Plain);
RequestInformation forwardRequest = _graphClient
.Users[_graphSettings.MailAddress]
.Messages[mailId]
.Forward
.ToPostRequestInformation(new ForwardPostRequestBody());
forwardRequest.Headers.Clear();
forwardRequest.Headers["Content-Type"] = new [] { MediaTypeNames.Text.Plain };
forwardRequest.Content = await stringContent.ReadAsStreamAsync(cancellationToken);
await _graphClient.RequestAdapter.SendNoContentAsync(forwardRequest, cancellationToken: cancellationToken);
Normally, when you forward a message via the other route like this:
ForwardPostRequestBody body = new() {
ToRecipients = new List<Recipient> {
new() { EmailAddress = new EmailAddress { Address = forwardToMail } }
}
};
await _graphClient
.Users[_graphSettings.MailAddress]
.Messages[mailId]
.Forward
.PostAsync(body);
Outlook displays a small blue arrow next to the mail, signaling, that it has been forwarded:
but this doesn't happen when you upload the
MimeContent
as seen in example one.
I've tried to update the MAPI Properties myself like this:
await _graphClient.Users[_graphSettings.MailAddress].Messages[mailId].PatchAsync(new Message {
SingleValueExtendedProperties = new List<SingleValueLegacyExtendedProperty> {
new() {
Id = "Integer {00062004-0000-0000-C000-000000000046} Id 0x1080",
Value = Convert.ToString(0x00000106)
}
}
}, cancellationToken: cancellationToken);
but this does not change the fact that the blue arrow is missing. I just add a custom SingleValueExtendedLegacyProperty
which does not change the displayed icon.
And now to my question:
Is this intended? Is the blue arrow supposed to be missing when I forward a mail via uploading the mime content? Is there some other way to update the status of the mail to something like IsForwarded
with the graph sdk or am I just supposed to use the other forwarding method in which I update the message instead of uploading the mime content?
Thanks in advance