From: Aditya Garg <gargaditya08@live•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: git@vger•kernel.org
Subject: [PATCH v2] send-email: pass smtp hostname and port to Authen::SASL
Date: Thu, 5 Mar 2026 17:01:15 +0000 [thread overview]
Message-ID: <MAUPR01MB1154634CC04D29AAF7CADE5F7B87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <MAUPR01MB11546AED093D8641767AACEFCB87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM>
Starting from version 2.2000, Authen::SASL supports passing the SMTP
server hostname and port to the OAUTHBEARER string passed via SMTP AUTH.
Add support for the same in git-send-email.
It's safe to add the new parameters unconditionally as older versions of
Authen::SASL will simply ignore them without any error. Something
similar is already being done for the authname parameter, which is not
supported by every authentication mechanism. This can be understood as
declaring a variable but not using at all.
Link: https://metacpan.org/pod/Authen::SASL::Perl::OAUTHBEARER
Signed-off-by: Aditya Garg <gargaditya08@live•com>
---
git-send-email.perl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/git-send-email.perl b/git-send-email.perl
index eed5420882..0ac4d634e8 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1474,6 +1474,8 @@ sub smtp_auth_maybe {
user => $cred->{'username'},
pass => $cred->{'password'},
authname => $cred->{'username'},
+ host => $smtp_server,
+ (defined $smtp_server_port ? (port => $smtp_server_port) : ()),
}
);
$result = $smtp->auth($sasl);
Range-diff against v1:
1: 9b48ca57ae ! 1: 5befaa626d send-email: pass smtp hostname and port to Authen::SASL
@@ Commit message
server hostname and port to the OAUTHBEARER string passed via SMTP AUTH.
Add support for the same in git-send-email.
+ It's safe to add the new parameters unconditionally as older versions of
+ Authen::SASL will simply ignore them without any error. Something
+ similar is already being done for the authname parameter, which is not
+ supported by every authentication mechanism. This can be understood as
+ declaring a variable but not using at all.
+
Link: https://metacpan.org/pod/Authen::SASL::Perl::OAUTHBEARER
Signed-off-by: Aditya Garg <gargaditya08@live•com>
--
2.52.0
prev parent reply other threads:[~2026-03-05 17:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 12:06 [PATCH] send-email: pass smtp hostname and port to Authen::SASL Aditya Garg
2026-03-05 14:44 ` Junio C Hamano
2026-03-05 15:14 ` Aditya Garg
2026-03-05 16:24 ` Junio C Hamano
2026-03-05 16:54 ` Aditya Garg
2026-03-05 17:01 ` Aditya Garg [this message]
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=MAUPR01MB1154634CC04D29AAF7CADE5F7B87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM \
--to=gargaditya08@live$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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