Retrieval of encrypted emails via Microsoft Graph

Questions, answers, tips and ideas on Servoy Client

Retrieval of encrypted emails via Microsoft Graph

Postby d.wanscheid » Wed Oct 12, 2022 9:07 am

Hello developers,

after Microsoft switched off the Basic-Authentification since 01. October 2022, we had to look for alternatives.
Since we have solved the problem with the OAuth2 method, the retrieval works wonderfully and is also currently used on productive systems at customers.

However, we have noticed that email encryption is becoming more and more present.

We retrieve our emails using the Microsoft Graph API. The message, i.e. the content of the email (HTML), is retrieved normally for encrypted emails (unencrypted). However, if attachments are included, we get a "smime.p7m" file. As it looks, it is a text file that contains encrypted attachments as Base64. We have not yet found a way to decrypt these attachments. We assume that we need some kind of certificate for this. On the Internet, there are hardly any possibilities presented.

We have also tried to parse the base64 block out of the text file and get the bytes out of it (utils.base64ToBytes(base64String:)), without success. As it looks, this block is also encrypted with some certificate, since the compiler does not recognize it as base64 text.

Does anyone have an idea how else to solve this? The API from Microsoft, doesn't provide any way to get the attachments unencrypted as it looks. As I said, we only receive the attachment with the name "smime.p7m".

We are looking forward to suggestions for a solution. :)
Posts: 8
Joined: Tue Sep 20, 2022 12:05 pm

Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 2 guests