email: Attempt to suppress email auto-replies.

This applies a commonly-used, though non-RFC, header which suppresses
auto-replies to the message.  There is a small chance that this will
result in bad filters thinking the messages *from Zulip* are
themselves auto-replies, but this seems a small risk.

Fixes: #13193.
This commit is contained in:
Alex Vandiver
2022-05-26 17:31:52 -07:00
committed by Tim Abbott
parent 1ea3f83c1e
commit 134977b590

View File

@@ -101,7 +101,11 @@ def build_email(
stringified = str(Address(addr_spec=to_user.delivery_email))
to_emails.append(stringified)
extra_headers = {}
# Attempt to suppress all auto-replies. This header originally
# came out of Microsoft Outlook and friends, but seems reasonably
# commonly-recognized.
extra_headers = {"X-Auto-Response-Suppress": "All"}
if realm is not None:
# formaddr is meant for formatting (display_name, email_address) pair for headers like "To",
# but we can use its utility for formatting the List-Id header, as it follows the same format,