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

Replies don't always retain the conversation_id #1223

Closed
claell opened this issue Sep 2, 2023 · 3 comments
Closed

Replies don't always retain the conversation_id #1223

claell opened this issue Sep 2, 2023 · 3 comments

Comments

@claell
Copy link
Contributor

claell commented Sep 2, 2023

Describe the bug
This seems to be a known problem (#703 #642). However, I see that for the create_reply and create_reply_all functions, sometimes, the conversation_id is retained, and sometimes it is not. I guess this is due to some automatic detection by EWS.

To Reproduce
None

Expected behavior
Outlook does set this reliably for the affected cases, if I create the reply (draft) there.

I was wondering, what causes this behavior, and whether there are ways to make this work.

Log output
None

Additional context
None

@claell
Copy link
Contributor Author

claell commented Sep 3, 2023

After experimenting a little, I saw that sometimes, the subject is a little different from the conversation_topic. For example, in a mailing list, the subject contains "[list-name]" as prefix, whereas conversation_topic doesn't contain that prefix. In the past, I set the reply subject based on the original subject. That then apparently also makes the reply conversation topic to contain the mailing list prefix. In such cases, the reply (draft) is not seen as part of the conversation and has a different conversation_id.

Example:

Original message:
subject: [list-name] some subject
conversation_topic: some subject

Reply (draft) based on the original subject <- this message has a different conversation_id after creating it:
subject: RE: [list-name] some subject
conversation_topic: [list-name] some subject

Reply (draft) created without the mailing list prefix <- this message has the original conversation_id after creating it:
subject: RE: some subject
conversation_topic: some subject

I also found https://learn.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-work-with-conversations-by-using-ews-in-exchange

Exchange applies the same ConversationTopic value to replies to the first message and then updates the ConversationIndex value to represent the message's position relative to the original message. If the subject of the email thread changes, Exchange applies a new ConversationTopic value and new ConversationIndex values to the new conversation.

Not sure whether that is connected.

For now, I'll use the conversation topic as base for the reply subject. Hopefully, that will work reliably.

@ecederstrand
Copy link
Owner

Thanks for the details investigation! conversation_id and conversation_topic fields are read-only and their value are determined by the Exchange server, as you've also found out.

I'm not sure there's anything more we can do in exchangelib in this area.

@claell
Copy link
Contributor Author

claell commented Sep 3, 2023

That's alright. I was mainly looking for ways how to be able to achieve what I want (having Outlook/Exchange treat messages as conversations when I want them to).

Apparently, I found a way (or a cause why it hasn't been the case before for some messages).

Then, I am happy to close this issue again for now.

@claell claell closed this as completed Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants