Re: [PATCH v2] send-email: add --smtp-outlook-id-tweak option
From: Junio C Hamano <hidden>
Date: 2025-04-28 20:47:23
Aditya Garg [off-list ref] writes:
Add an option to allow users to specifically enable or disable retrieving the Message-ID from the Outlook SMTP server. This can be used for other hosts mimicking the behaviour of Outlook, or for users who set a custom domain to be a CNAME for the Outlook SMTP server. Helped-by: Junio C Hamano [off-list ref] Signed-off-by: Aditya Garg <redacted> --- v2: Replace tab with spaces in "outlookidtweak" => \$outlook_id_tweak,
Good eyes ;-)
+--smtp-outlook-id-tweak=(always|never|auto):: + Outlook servers discard the Message-ID sent via email and assign a + new random Message-ID, thus breaking threads. ++ +-- +- 'auto' will attempt to retrieve the ID from the server only if the SMTP + server is 'smtp.office365.com' or 'smtp-mail.outlook.com'. +- 'always' will attempt to retrieve the ID from the server irrespective of + the SMTP server being used. Use only if Microsoft is your email provider. +- 'never' will disable this tweak irrespective of theSMTP server being used.
It is a shame that this is not just a simple boolean. Those who
expect 'true' to kick in would be disappointed to find that their
'true' means the same thing as 'auto'.
If I were designing this feature, I would rather make it say:
--[no-]outlook-message-id-fix::
Outlook servers [DO THIS]. Giving this option reads the
message-id assigned by the Outlook server and use it as the
In-Reply-To message ID for subsequent messages. Without the
option, connections to only ... and ... automatically gets
this tweak. Pass `--no-outlook-message-id-fix` to disable
the fix even for these hosts.
and make the implementation behave that way.
Note that this is a command line option that is specific to
git-send-email, so I omitted "smtp" from the name and instead
replaced 'id' with 'message-id' to make it more explicit what
gets munged.
But I do not care too deeply either way. Let me queue the patch
as-is for now.
Thanks.