From b10fb23d52425644b8c3bb9b7277cb3328a73c16 Mon Sep 17 00:00:00 2001 From: Aditya Garg Date: Thu, 5 Mar 2026 17:01:15 +0000 Subject: [PATCH] send-email: pass smtp hostname and port to Authen::SASL 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 Signed-off-by: Junio C Hamano --- git-send-email.perl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-send-email.perl b/git-send-email.perl index cd4b316ddc..350afa3e71 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);