OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
670 stars 96 forks source link

getAttachmentContentAsync doesn't work after few attempts when mail is encrypted with Option "Encrypt" Or "Do not forward" #4725

Open pza-dev-brcm opened 1 month ago

pza-dev-brcm commented 1 month ago

We are using ItemSend event in outlook add-in where we monitor email content like subject, body, recipients, attachments and based on policy we decide whether to allow or block the email.

Use case: When the email with attachment is encrypted before sending with "Encrypt" or "Do not forward" option; If the attachment contents violates our policy, then we are blocking the email with event.completed({allowEvent: false});

Now, if user retries this send operation after just editing subject each time, then for 2 or 3 attempts email is getting blocked as per our logic. Which is expected. After some more attempts we fail to get the content of file with getAttachmentContentAsync API in add-in and as a result email is getting sent. (As there are no file contents to validate).

Expected result: getAttachmentContentAsync should return correct content every time it is called, even though it is encrypted with "Encrypt" Or "Do not Forward" option

Note: getAttachmentContentAsync API is succeeded but content length is zero. When subject is changed for each retry then this issue getting reproduced consistently.

Environment Platform [PC desktop, Mac, iOS, Office on the web]: PC desktop, On the web Host [Excel, Word, PowerPoint, etc.]: New outlook Office version number: You have Microsoft Outlook Version 1.2024.708.100 (Production). Client Version is 20240712002.10 webview2 version is 126.0.2592.113 Operating System: win 11 Browser (if using Office on the web): Chrome

dahuja10 commented 1 month ago

Thanks for reporting this issue regarding getAttachmentContentAsync. It has been put on our backlog. Unfortunately, we do not have a timeline to share at this point.

Internal Tracking Id: 4788294