git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Aditya Garg <gargaditya08@live.com>
Cc: Julian Swagemakers <julian@swagemakers.org>,
	git@vger.kernel.org, M Hickford <mirth.hickford@gmail.com>,
	sandals@crustytoothpaste.net, Shengyu Qu <wiagn233@outlook.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Erik Huelsmann <ehuels@gmail.com>
Subject: Re: [PATCH v6 1/1] send-email: retrieve Message-ID from outlook SMTP server
Date: Fri, 25 Apr 2025 10:23:11 -0700	[thread overview]
Message-ID: <xmqqikmstatc.fsf@gitster.g> (raw)
In-Reply-To: <PN3PR01MB9597A549B8A6752F2F828266B8842@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM> (Aditya Garg's message of "Fri, 25 Apr 2025 10:09:09 +0000")

Aditya Garg <gargaditya08@live.com> writes:

> +sub is_outlook {
> +	my ($host) = @_;
> +	return ($host eq 'smtp.office365.com' || $host eq 'smtp-mail.outlook.com');
> +}

There were a few messages that raised concerns with respect to
on-prem installations of Outlook based servers, where the hostname
cannot be used to tell if we need this message-id tweaking.

The following is a completely untested patch, but it should be
sufficient to illustrate how simple it would be to support an
option to do so, if we cared about the issue enough.

Will queue your patch _without_ this tweak, at least for now.

Thanks.

 git-send-email.perl | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git c/git-send-email.perl w/git-send-email.perl
index 618474916e..dff3d861e4 100755
--- c/git-send-email.perl
+++ w/git-send-email.perl
@@ -60,6 +60,7 @@ sub usage {
     --smtp-user             <str>  * Username for SMTP-AUTH.
     --smtp-pass             <str>  * Password for SMTP-AUTH; not necessary.
     --smtp-encryption       <str>  * tls or ssl; anything else disables.
+    --smtp-outlook-id-tweak <0|1>  * The server munges Message-ID.
     --smtp-ssl                     * Deprecated. Use '--smtp-encryption ssl'.
     --smtp-ssl-cert-path    <str>  * Path to ca-certificates (either directory or file).
                                      Pass an empty string to disable certificate
@@ -290,6 +291,7 @@ sub do_edit {
 my $mailmap = 0;
 my $target_xfer_encoding = 'auto';
 my $forbid_sendmail_variables = 1;
+my $outlook_id_tweak = -1; # we need to tell --no-opt and lack of it
 
 my %config_bool_settings = (
     "thread" => \$thread,
@@ -305,6 +307,7 @@ sub do_edit {
     "xmailer" => \$use_xmailer,
     "forbidsendmailvariables" => \$forbid_sendmail_variables,
     "mailmap" => \$mailmap,
+    "outlookidtweak" => \$outlook_id_tweak,
 );
 
 my %config_settings = (
@@ -518,6 +521,7 @@ sub config_regexp {
 		    "smtp-pass:s" => \$smtp_authpass,
 		    "smtp-ssl" => sub { $smtp_encryption = 'ssl' },
 		    "smtp-encryption=s" => \$smtp_encryption,
+		    "smtp-outlook-id-tweak!" => \$outlook_id_tweak,
 		    "smtp-ssl-cert-path=s" => \$smtp_ssl_cert_path,
 		    "smtp-debug:i" => \$debug_net_smtp,
 		    "smtp-domain:s" => \$smtp_domain,
@@ -1576,7 +1580,13 @@ sub gen_header {
 
 sub is_outlook {
 	my ($host) = @_;
-	return ($host eq 'smtp.office365.com' || $host eq 'smtp-mail.outlook.com');
+
+	if ($outlook_id_tweak < 0) {
+		$outlook_id_tweak = 
+		    ($host eq 'smtp.office365.com' ||
+		     $host eq 'smtp-mail.outlook.com') ? 1 : 0;
+	}
+	return $outlook_id_tweak;
 }
 
 # Prepares the email, then asks the user what to do.

  parent reply	other threads:[~2025-04-25 17:23 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 12:19 [PATCH v4 0/3] send-email: add oauth2 support and fix outlook breaking threads Aditya Garg
2025-04-23 12:19 ` [PATCH v4 1/3] send-email: implement SMTP bearer authentication Aditya Garg
2025-04-23 18:04   ` Junio C Hamano
2025-04-23 18:33     ` Aditya Garg
2025-04-24  6:36       ` Greg Kroah-Hartman
2025-04-24  8:23         ` Aditya Garg
2025-04-23 12:19 ` [PATCH v4 2/3] send-email: retrieve Message-ID from outlook SMTP server Aditya Garg
2025-04-23 18:54   ` Junio C Hamano
2025-04-23 22:52   ` brian m. carlson
2025-04-24  3:42     ` Aditya Garg
2025-04-23 12:19 ` [PATCH v4 3/3] send-email: add option to generate passswords like OAuth2 tokens Aditya Garg
2025-04-23 19:03   ` Junio C Hamano
2025-04-24  3:29     ` Aditya Garg
2025-04-24 12:43       ` Junio C Hamano
2025-04-23 20:50 ` [PATCH v4 0/3] send-email: add oauth2 support and fix outlook breaking threads M Hickford
2025-04-24  3:44   ` Aditya Garg
2025-04-24  7:53 ` [PATCH v5 " Aditya Garg
2025-04-24  7:53   ` [PATCH v5 1/3] send-email: implement SMTP bearer authentication Aditya Garg
2025-04-24 12:12     ` Julian Swagemakers
     [not found]     ` <CACOoB6jE=DgpYYaudhqTVDRd2SCz++aog7QYwTQs6-MAD8dBuw@mail.gmail.com>
2025-04-24 18:22       ` Aditya Garg
2025-04-24 19:20         ` Erik Huelsmann
2025-04-25  6:19         ` Julian Swagemakers
2025-04-25  6:25           ` Aditya Garg
2025-04-25  9:45           ` Aditya Garg
2025-04-25 10:17             ` Erik Hulsmann
2025-04-24 18:23       ` Aditya Garg
2025-04-24  7:53   ` [PATCH v5 2/3] send-email: retrieve Message-ID from outlook SMTP server Aditya Garg
2025-04-24 13:09     ` Greg Kroah-Hartman
2025-04-26 18:11       ` Yao Zi
2025-04-27 20:05         ` Aditya Garg
2025-04-28  4:16           ` Yao Zi
2025-04-27 19:44       ` Aditya Garg
2025-04-24  7:53   ` [PATCH v5 3/3] send-email: add option to generate passswords like OAuth2 tokens Aditya Garg
2025-04-24 12:28     ` Julian Swagemakers
2025-04-24 12:53       ` Aditya Garg
2025-04-24 15:20         ` Junio C Hamano
2025-04-24 15:46           ` Aditya Garg
2025-04-24 16:58             ` Junio C Hamano
2025-04-25 10:09 ` [PATCH v6 0/1] send-email: add oauth2 support and fix outlook breaking threads Aditya Garg
2025-04-25 10:09   ` [PATCH v6 1/1] send-email: retrieve Message-ID from outlook SMTP server Aditya Garg
2025-04-25 15:04     ` Aditya Garg
2025-04-25 16:22       ` Erik Huelsmann
2025-04-25 17:08         ` Junio C Hamano
2025-04-25 19:05           ` Erik Huelsmann
2025-04-25 19:08             ` Aditya Garg
2025-04-25 17:23     ` Junio C Hamano [this message]
2025-04-25 19:05       ` Aditya Garg
2025-04-26  8:36       ` Aditya Garg
2025-04-26  9:03         ` Eric Sunshine
2025-04-26 17:40           ` Aditya Garg
2025-04-28 16:52         ` Junio C Hamano
2025-04-28 17:52           ` [PATCH] send-email: add --smtp-outlook-id-tweak option Aditya Garg
2025-04-28 17:57             ` [PATCH v2] " Aditya Garg
2025-04-28 20:47               ` Junio C Hamano
2025-04-29  3:44                 ` Aditya Garg
2025-04-29 10:52             ` [PATCH v3] send-email: add --[no-]outlook-id-fix option Aditya Garg
2025-04-29 11:00               ` Aditya Garg
2025-04-29 15:57               ` Junio C Hamano
2025-04-29 16:24               ` Junio C Hamano
2025-04-29 16:26                 ` Aditya Garg
2025-04-29 16:37             ` [PATCH v4] " Aditya Garg
2025-04-29 23:08               ` Junio C Hamano
2025-04-30  8:31                 ` Aditya Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqikmstatc.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ehuels@gmail.com \
    --cc=gargaditya08@live.com \
    --cc=git@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=julian@swagemakers.org \
    --cc=mirth.hickford@gmail.com \
    --cc=sandals@crustytoothpaste.net \
    --cc=wiagn233@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).