git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] send-email: pass smtp hostname and port to Authen::SASL

From
Aditya Garg <gargaditya08@live.com>
Date
Mar 5, 2026, 17:01 UTC
Message-ID
<MAUPR01MB1154634CC04D29AAF7CADE5F7B87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM>
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
Previous: Aditya Garg
Message 6 of 6 in “send-email: pass smtp hostname and port to Authen::SASL”
  1. send-email: pass smtp hostname and port to Authen::SASLAditya Garg, Mar 5, 2026
  2. Junio C HamanoMar 5, 2026
  3. Aditya GargMar 5, 2026
  4. Junio C HamanoMar 5, 2026
  5. Aditya GargMar 5, 2026
  6. send-email: pass smtp hostname and port to Authen::SASLAditya Garg, Mar 5, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.