ecederstrand/exchangelib

Adding The "X-Auto-Response-Suppress" Header Ignored when sending emails

AradCarmi opened this issue · 4 comments

Describe the bug
I'm trying to ignore replies when sending emails using the "X-Auto-Response-Suppress" header to my Message but when reading the incoming email (the .eml file), the headers have been omitted. Sending other headers seems to be working well.

To Reproduce
Send a message adding the "X-Auto-Response-Suppress" header.

Expected behavior
The header should be added to the request.

Additional context
exchange-lib version: 4.9.0
python version: 3.10.13

How are you sending the message? send_email is not something that exists in exchangelib.

In my testing I have not been able to create messages with headers via EWS. Therefore, this field is treated as read-only in exchangelib:

headers = MessageHeaderField(field_uri="item:InternetMessageHeaders", is_read_only=True)

If you have reason to believe that this field is indeed writeable, then please note it here.

Sorry for the mistake, I meant to the send_and_save function within the Message class.
I was able to add to my Message object a header as a kwargs (It parses as ExtendedPropertyField not sure the meaning of this) and when adding the specific X-Auto-Response-Suppress header it fails to add it (I can't see the header in the .eml file).
Is there a better solution for adding a header to the request instead of adding it to the Message as a property?
I'm looking for a solution to ignore the auto replies from the 'OOF' mailboxes.
Thanks in advance.

Oh, are you referring to a solution like the one provided in #1257 (comment)?

I haven't tested sending message headers defined via extended properties before. To find a working solution for your use case, I would probably start by sending an email via Outlook that works as intended, and then use exchangelib so inspect the sent message and see which headers Outlook defined to avoid autoreplies.

Again, you really need to post a minimal example of what you're doing so it's possible to discuss and reproduce.

Closing. Feel free to reopen if you get back to this.