Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message internetHeaders are not available in message when it is in the sent items folder #5413

Open
digiofficerobin opened this issue Feb 20, 2025 · 3 comments
Assignees
Labels
Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback Possible-Solution Similar-Issue

Comments

@digiofficerobin
Copy link

digiofficerobin commented Feb 20, 2025

Type of issue

Missing information

Feedback

Steps to reproduce:

  1. Compose new e-mail
  2. Set the recipient emailadress to yourself.
  3. Click Send
  4. OnSend event we set internet message header, for example with code:
Office.context.mailbox.item.internetHeaders.setAsync(
    { "X-DO-Register-in-DMS": "true", "X-DO-ID": "9876" },
    (asyncResult) => {
        if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
          console.log("Successfully set headers");
          resolve();
        } else {
          reject("Error setting headers: " + JSON.stringify(asyncResult.error));
        }
      }
    );
 });
  1. Find the sent message
    https://graph.microsoft.com/v1.0/me/mailFolders(%27sentitems%27)/messages/?$select=subject,internetMessageHeaders
  2. Find the incoming message
    https://graph.microsoft.com/v1.0/me/mailFolders(%27inbox%27)/messages/?$select=subject,internetMessageHeaders

Issue
The internet header 'X-DO-ID' with value '9876' is only available on the received (incoming) message, but not on the sent message.

Note that the internet message header is visible on both the sent and received message if the eml is downloaded via Graph API, so the internet headers are available.

https://graph.microsoft.com/v1.0/Users/04bbe563-08e0-4dd8-994c-61dcf1819c87/Messages/{message-id}/$value

Expected
Both sent and received messages should contain the internet message headers if the messages are retrieved with:
https://graph.microsoft.com/v1.0/me/mailFolders(%27sentitems%27)/messages/?$select=subject,internetMessageHeaders

Background info
Eventually we want to receive the internet header messages in a rich notification as a webhook on the sent items folder.
https://learn.microsoft.com/en-us/graph/change-notifications-with-resource-data?tabs=csharp

Page URL

https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/internet-headers

Content source URL

https://github.com/OfficeDev/office-js-docs-pr/blob/main/docs/outlook/internet-headers.md

Author

@o365devx

Document Id

e465cfb6-e349-1d24-30b2-2ea4bc56d976

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Feb 20, 2025
@wamaina wamaina added Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Feb 20, 2025
@samantharamon samantharamon transferred this issue from OfficeDev/office-js-docs-pr Feb 20, 2025
@samantharamon samantharamon removed their assignment Feb 20, 2025
Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

In Win32, all internet headers are saved to a MAPI prop while composing / in draft mode. They are converted to actual internet headers when sending the email. OWA doesn't care about the Win32 MAPI prop since they handle internet headers differently. If you do believe the consistency of internet header is important, you can always submit a feature request on our Tech Community Page with the appropriate label(s).

Reference:

Powered by issue-sentinel

@samantharamon
Copy link

Hi @digiofficerobin,

Thanks for reporting this issue. Do you see this behavior in all platforms or only specific ones?

@samantharamon samantharamon added Needs: author feedback Waiting for author (creator) of Issue to provide more info and removed Needs: attention 👋 Waiting on Microsoft to provide feedback labels Feb 20, 2025
@exextoc exextoc added the Needs: attention 👋 Waiting on Microsoft to provide feedback label Feb 20, 2025
@digiofficerobin
Copy link
Author

Hi @digiofficerobin,

Thanks for reporting this issue. Do you see this behavior in all platforms or only specific ones?

I don't know what you mean with 'all platforms'. We use Office.js with Outlook online (New Outlook in the web browser) and Graph API as mentioned in the issue description.

Our objective is to automatically track sent emails and secure them in our Document Management System (DMS). Currently, Office.js only provides a 'before send' event, but not an 'after send' event. We aim to download a copy of the sent email. To facilitate tracking, we propose adding an internet message header to distinguish between emails that should be stored in the DMS and those that should not. If this should be done in another way we would like to hear that.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: author feedback Waiting for author (creator) of Issue to provide more info label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback Possible-Solution Similar-Issue
Projects
None yet
Development

No branches or pull requests

4 participants