Closed janjaeschke closed 1 month ago
The same for Outlook for Mac. Here is my sample repository for more info: https://github.com/DanilKorotenko/OutlookAddinSetInternetHeaders
@DanilKorotenko , to retrieve the internet headers on the received email in the recipients mailbox, you can use Office.context.mailbox.item.getAllInternetHeadersAsync
. This will give all the internet headers on the item, and then you can check to see if yours was preserved or not.
More documentation about this API can be found here: https://learn.microsoft.com/en-us/javascript/api/outlook/office.messageread?view=outlook-js-preview#outlook-office-messageread-getallinternetheadersasync-member(1)
Are you saying that your add-in is calling Office.context.mailbox.item.getAllInternetHeadersAsync
but the async result doesn't contain your header? I checked your add-in's source code, thanks for sharing the link. I couldn't find any calls to this API, so maybe that's the missing piece here?
@exextoc due to the "Needs: author feedback" tag I like to redirect the topic in the original direction.
We are able to see the header while preparing the email, it is just missing on the recipients side which from our part is check on the third party recipients email server. The incoming email was dumped without any changes.
Edit: During my reply I noticed that the tag change was automatic, sorry for my misunderstanding.
@janjaeschke, my apologies. The previous reply was actually meant for you, not @DanilKorotenko.
To clarify further, are you saying that the headers are missing when the recipient's mailbox is on a third-party mail server, however, everything works as expected if the recipient's mailbox is using Microsoft Exchange?
Is this third-party mail server a publicly-available one that anyone can create a test mailbox for?
@exextoc no worries about that.
No the header is never applied on an outbound email, even if I sent the email in the same O365 tenant using the local outlook client. It is always working if I use the OWA or the new web based Outlook client.
The third-party mail server is not publicly-available but I can 100% confirm that the server is not removing the header. It is managed by ourself.
@janjaeschke, how are you retrieving the headers once the email has arrived in the recipient's Inbox? Are you using one of our APIs or are you inspecting the item some other way?
@exextoc In case of my O365 recipient I used Outlook.com -> opened the message -> View -> View message details. For my local recipient I can dump the EML using the email server itself and I created a network trace while receiving it. In each case the header is missing.
it is working now for me.
Glad it is working for you now. If there's anything you did differently that potentially resulted in fixing this issue, please do so to help future readers of this post.
@exextoc just to make sure: it is still not working on our side.
@DanilKorotenko did you change anything?
@janjaeschke Actually, I thought that it was fixed on your side. Because, on my side, this issue is reproduced in Outlook for Mac 16.74 (23061100). And, it didn't reproduce in ver.: Outlook for Mac 16.74.1 (23061800)
@janjaeschke For now, 16.75.2 (23072301), everything works perfect. Thank you.
@janjaeschke I don't know the situation with Outlook for Windows, but for Mac, all works good.
Thank you for the update.
I am currently at version: Microsoft® Outlook® für Microsoft 365 MSO (Version 2306 Build 16.0.16529.20164) 64 Bit on Windows and it is still not working.
@janjaeschke, I just tried a more recent version of Microsoft Outlook. I composed an email from a test account in a Microsoft 365 tenant, added an internet header using Office.context.mailbox.item.internetHeaders.setAsync
, then confirmed that the headers had been set with Office.context.mailbox.item.internetHeaders.getAsync
, sent the email to a test account @outlook.com. When I inspect the email received by the test account @outlook.com, it correctly contains the headers I set during compose.
Step by step of my test:
Office.context.mailbox.item.internetHeaders.setAsync(
{ "key11" : "value11" },
function (asyncResult) {
console.log(JSON.stringify(asyncResult));
}
);
Office.context.mailbox.item.internetHeaders.getAsync(
[ "key11" ],
function (asyncResult) {
console.log(JSON.stringify(asyncResult));
}
);
key11: value11
in the list of headers.Is there anything significantly different from my repro steps and yours?
@exextoc Yes the difference seems to be the header name. I used your steps, which are identical to ours, to make sure the issue still exists in my current Outlook version. While testing the steps I also tried your header name "key11" and this was working fine. So I played around and it looks like that just the name of our header has the issue:
Office.context.mailbox.item.internetHeaders.setAsync(
{ "X-NoSpamProxy-RequireAttachmentPassword" : "true" },
function (asyncResult) {
console.log(JSON.stringify(asyncResult));
}
);
Sets the header and the getAsync returns it but the delivered email does not include the header. To be really sure that my tenant does not have any strange configuration I used a new one where exchange online was never touched before and the issue was reproducible.
Please check if it is the same in your environment.
@janjaeschke, I just checked my environment. I used both Outlook.com and my test tenant, and your code works perfectly for me. The received emails also contain your header. Below is a screenshot.
I just created a fresh test tenant, tried your code, and it worked as expected. The received email contains the X-NoSpamProxy-RequireAttachmentPassword header key with a value of "true".
Do you mind creating a test account for me to use to reproduce this issue? You can create a private GitHub repository and @-mention exextoc so that I can access it for the details.
@exextoc as mentioned in the opening message Outlook.com and the new web based Outlook is working fine. The issue only occurs with the normal outlook client on you windows PC.
Just add our Outlook.com account to the Outlook client and add the header again over the Viva Insights Add-In pane. As recipient you can use another user of the same O365 tenant.
The header should be missing
@janjaeschke, I used the Windows Desktop Outlook client connected to an Outlook.com account and also to my test tenant. I understand that you are not referring to the web client since everything is working fine there. All my communications and validations have been about the Windows Desktop Outlook client.
This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!
This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!
@exextoc thank you for the clarification.
I created a private repository (https://github.com/noSpamProxy/office-js-3393) with two accounts of my testing O365 tenant and the code I use through the console to add the header.
Please let me know if there is any issue accessing the repository.
@janjaeschke, thanks for the private repository. Using my own test add-in, I set the headers specified in your private repo's README file. I tried both sending the email to the same account and then sending from one account to the other, as you mentioned in your README file. Both of them worked successfully. The internet headers were present in both cases.
Can you check the recipient's Inbox (using the Desktop Outlook client) for an email titled "test with X-NoSpamProxy-RequireAttachmentPassword to Grady" and inspect it to see if your header is present?
Below is a screenshot with all internet headers cropped out except yours:
@exextoc thank you for testing it out.
I can see your email and I can confirm that the header is present. It makes me clueless that we are running into this issue and you are not... Are you using a later Outlook version or do you have any other idea how to analyse this further?
@janjaeschke, yes, I'm using a newer version of Outlook. My version is a pre-release of 2308, so not very far off from your highest version number of 2307 that you mentioned in the private repository.
It seems you are able to reproduce this issue with 2304 and 2307. If that's accurate, kindly let me know. I'm going to try out your test accounts with 2307.
@exextoc yes your assumption is correct.
I am running 2307 as daily driver and the issue is reproducible every time with it.
@exextoc any updates on this topic?
Can we connect offline to look into this further? Please create a private repo, place your email address in there, and then at-mention me and I will connect with you offline to discuss further. Alternatively, if you update your profile with your email address, I can grab it from your profile. Thanks.
For sure we can talk offline about this. I updated the existing private repository with my email address: https://github.com/noSpamProxy/office-js-3393 You should still have access to it.
@exextoc Do you have an update here?
@exextoc any news here? I still did not receive an email :(
@janjaeschke, apologies for the delay here. The private repository you created earlier on is no longer available. Please create another one with your contact information and then I will email you. The email user will be a test account named DebraB, so please check your spam folder if you haven't received the email after I confirm sending it. Thanks.
Hi @exextoc. I'm taking over for my colleague Jan for the moment.
You should already have access to the repo:
@exextoc Anything new on this case?
@exextoc I am a bit surprised you didn't had access anymore. Was Hennings help useful? How can we process further in this topic?
We need to find any kind of a solution for this, the new Outlook seems to become more popular and it is impossible for us to support this platform with good feelings.
@exextoc Any news on this case?
Due to the age and missing responses I tried to reproduce this issue nearly 1 year later. I wasn't able to reproduce it anymore and hope it is fixed by an Outlook version update which might be delivered to the most customers.
Issue closed.
PLEASE NOTE: The behaviour described here is exactly the same as what is described in a ticket from December 2020, here: https://github.com/OfficeDev/office-js/issues/1401 and November 2022: https://github.com/OfficeDev/office-js/issues/2952
Setting headers from a taskpane does not return an error but the recipient will not see the the desired headers. Conclusion: headers are not attached to the email.
Using OWA or the new preview version of Outlook on a desktop PC the headers are added properly.
Your Environment
Expected Behavior
Headers that are set will persist and be sent with the message.
Current behavior
Calling the setAsync methods returns as successful but the header is not persisted when the message arrives in the recipients mailbox.
When the same code is run in either OWA or the preview of the new Outllook for Windows, the headers are present as expected when the message arrives in the recipients mailbox.
Steps to reproduce
Context
We developed an add-in for our product to provide some features through Outlook. The add-in will change the behavior of the email processing using specific mail headers. It is impossible for us to support users with the original Outlook application unless the issue is resolved.
Useful logs
An example of the live add-in, checking the header before it should be set and afterwards: