{"thread":{"id":"65139","subject":"[PATCH] send-email: pass smtp hostname and port to Authen::SASL","startedAt":"2026-03-05T12:06:36Z","lastAt":"2026-03-05T17:01:39Z","messageCount":6,"participants":["Aditya Garg","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"537926","messageId":"MAUPR01MB11546AED093D8641767AACEFCB87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM","threadId":"65139","inReplyTo":null,"subject":"[PATCH] send-email: pass smtp hostname and port to Authen::SASL","fromName":"Aditya Garg","fromEmail":"gargaditya08@live.com","sentAt":"2026-03-05T12:06:21Z","receivedAt":"2026-03-05T12:06:36Z","isPatch":true,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"Starting from version 2.2000, Authen::SASL supports passing the SMTP\nserver hostname and port to the OAUTHBEARER string passed via SMTP AUTH.\nAdd support for the same in git-send-email.\n\nLink: https://metacpan.org/pod/Authen::SASL::Perl::OAUTHBEARER\n\nSigned-off-by: Aditya Garg <gargaditya08@live.com>\n---\n git-send-email.perl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex eed5420882..0ac4d634e8 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1474,6 +1474,8 @@ sub smtp_auth_maybe {\n \t\t\t\t\t\tuser     => $cred->{'username'},\n \t\t\t\t\t\tpass     => $cred->{'password'},\n \t\t\t\t\t\tauthname => $cred->{'username'},\n+\t\t\t\t\t\thost     => $smtp_server,\n+\t\t\t\t\t\t(defined $smtp_server_port ? (port => $smtp_server_port) : ()),\n \t\t\t\t\t}\n \t\t\t\t);\n \t\t\t\t$result = $smtp->auth($sasl);\n-- \n2.52.0\n\n"},{"id":"537976","messageId":"87ldg6jpy0.fsf@gitster.g","threadId":"65139","inReplyTo":"MAUPR01MB11546AED093D8641767AACEFCB87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM","subject":"Re: [PATCH] send-email: pass smtp hostname and port to Authen::SASL","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-05T14:44:55Z","receivedAt":"2026-03-05T14:45:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Aditya Garg <gargaditya08@live.com> writes:\n\n[administrivia]\n\n    Please do not send patch e-mails directly at me, unless you know\n    that I am the area authority.  Initial submissions are better\n    sent to the list on To: list, with area experts on Cc: if you\n    know or found out who they are.\n\n> Starting from version 2.2000, Authen::SASL supports passing the SMTP\n> server hostname and port to the OAUTHBEARER string passed via SMTP AUTH.\n> Add support for the same in git-send-email.\n\nThe proposed log message should answer these questions as well:\n\n   What happens with version before 2.2000?  Is it safe to\n   unconditionally add parameters like this patch does, and why?\n\n> Link: https://metacpan.org/pod/Authen::SASL::Perl::OAUTHBEARER\n>\n> Signed-off-by: Aditya Garg <gargaditya08@live.com>\n> ---\n>  git-send-email.perl | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index eed5420882..0ac4d634e8 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -1474,6 +1474,8 @@ sub smtp_auth_maybe {\n>  \t\t\t\t\t\tuser     => $cred->{'username'},\n>  \t\t\t\t\t\tpass     => $cred->{'password'},\n>  \t\t\t\t\t\tauthname => $cred->{'username'},\n> +\t\t\t\t\t\thost     => $smtp_server,\n> +\t\t\t\t\t\t(defined $smtp_server_port ? (port => $smtp_server_port) : ()),\n>  \t\t\t\t\t}\n>  \t\t\t\t);\n>  \t\t\t\t$result = $smtp->auth($sasl);\n\nThanks.\n"},{"id":"537978","messageId":"MAUPR01MB115467BA486F4F9B4E6829D64B87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM","threadId":"65139","inReplyTo":"87ldg6jpy0.fsf@gitster.g","subject":"Re: [PATCH] send-email: pass smtp hostname and port to Authen::SASL","fromName":"Aditya Garg","fromEmail":"gargaditya08@live.com","sentAt":"2026-03-05T15:14:44Z","receivedAt":"2026-03-05T15:14:47Z","isPatch":true,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"\n\n> On 5 Mar 2026, at 8:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> \n> ﻿Aditya Garg <gargaditya08@live.com> writes:\n> \n> [administrivia]\n> \n>    Please do not send patch e-mails directly at me, unless you know\n>    that I am the area authority.  Initial submissions are better\n>    sent to the list on To: list, with area experts on Cc: if you\n>    know or found out who they are.\n\nOh sorry. I just did whatever I did in my previous contributions. I didn't know the rules changed.\n\nWill mail just the mailing list next time.\n\n> \n>> Starting from version 2.2000, Authen::SASL supports passing the SMTP\n>> server hostname and port to the OAUTHBEARER string passed via SMTP AUTH.\n>> Add support for the same in git-send-email.\n> \n> The proposed log message should answer these questions as well:\n> \n>   What happens with version before 2.2000?  Is it safe to\n>   unconditionally add parameters like this patch does, and why?\n\nIt's safe to add parameters unconditionally because the library will simply reject them without any error. It's basically like declaring a variable and not using it anywhere for older versions. I have tested this with old libraries as well.\n\nConsider the fact that the authname variable is also not in every authentication method used by Authen SASL, still its declared unconditionally before.\n\n> \n>> Link: https://metacpan.org/pod/Authen::SASL::Perl::OAUTHBEARER\n>> \n>> Signed-off-by: Aditya Garg <gargaditya08@live.com>\n>> ---\n>> git-send-email.perl | 2 ++\n>> 1 file changed, 2 insertions(+)\n>> \n>> diff --git a/git-send-email.perl b/git-send-email.perl\n>> index eed5420882..0ac4d634e8 100755\n>> --- a/git-send-email.perl\n>> +++ b/git-send-email.perl\n>> @@ -1474,6 +1474,8 @@ sub smtp_auth_maybe {\n>>                        user     => $cred->{'username'},\n>>                        pass     => $cred->{'password'},\n>>                        authname => $cred->{'username'},\n>> +                        host     => $smtp_server,\n>> +                        (defined $smtp_server_port ? (port => $smtp_server_port) : ()),\n>>                    }\n>>                );\n>>                $result = $smtp->auth($sasl);\n> \n> Thanks.\n"},{"id":"537980","messageId":"xmqqms0m452i.fsf@gitster.g","threadId":"65139","inReplyTo":"MAUPR01MB115467BA486F4F9B4E6829D64B87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM","subject":"Re: [PATCH] send-email: pass smtp hostname and port to Authen::SASL","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-05T16:24:53Z","receivedAt":"2026-03-05T16:24:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Aditya Garg <gargaditya08@live.com> writes:\n\n>> On 5 Mar 2026, at 8:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> \n>> ﻿Aditya Garg <gargaditya08@live.com> writes:\n>> \n>> [administrivia]\n>> \n>>    Please do not send patch e-mails directly at me, unless you know\n>>    that I am the area authority.  Initial submissions are better\n>>    sent to the list on To: list, with area experts on Cc: if you\n>>    know or found out who they are.\n>\n> Oh sorry. I just did whatever I did in my previous contributions. I didn't know the rules changed.\n\nNo rule changes as far as I know.\n\n>>> Starting from version 2.2000, Authen::SASL supports passing the SMTP\n>>> server hostname and port to the OAUTHBEARER string passed via SMTP AUTH.\n>>> Add support for the same in git-send-email.\n>> \n>> The proposed log message should answer these questions as well:\n>> \n>>   What happens with version before 2.2000?  Is it safe to\n>>   unconditionally add parameters like this patch does, and why?\n>\n> It's safe to add parameters unconditionally because the library\n> will simply reject them without any error. It's basically like\n> declaring a variable and not using it anywhere for older\n> versions. I have tested this with old libraries as well.\n>\n> Consider the fact that the authname variable is also not in every\n> authentication method used by Authen SASL, still its declared\n> unconditionally before.\n\nThese are good to have in the proposed log message.\n\nThanks.\n"},{"id":"537981","messageId":"MAUPR01MB1154638D0656DAC084F4EDC73B87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM","threadId":"65139","inReplyTo":"xmqqms0m452i.fsf@gitster.g","subject":"Re: [PATCH] send-email: pass smtp hostname and port to Authen::SASL","fromName":"Aditya Garg","fromEmail":"gargaditya08@live.com","sentAt":"2026-03-05T16:54:20Z","receivedAt":"2026-03-05T16:54:29Z","isPatch":true,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"\n\nOn 05/03/26 9:54 pm, Junio C Hamano wrote:\n> Aditya Garg <gargaditya08@live.com> writes:\n> \n>>> On 5 Mar 2026, at 8:15 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>>>\n>>> ﻿Aditya Garg <gargaditya08@live.com> writes:\n>>>\n>>> [administrivia]\n>>>\n>>>    Please do not send patch e-mails directly at me, unless you know\n>>>    that I am the area authority.  Initial submissions are better\n>>>    sent to the list on To: list, with area experts on Cc: if you\n>>>    know or found out who they are.\n>>\n>> Oh sorry. I just did whatever I did in my previous contributions. I didn't know the rules changed.\n> \n> No rule changes as far as I know.\n\nI had sent several patches for send-email and imap-send between 2.50 and 2.52, and in every submission I did email directly to the maintainers. Maybe you were just lenient with me that time. Regardless, I'll make sure that future patches are sent only to the mailing list.\n\n> \n>>>> Starting from version 2.2000, Authen::SASL supports passing the SMTP\n>>>> server hostname and port to the OAUTHBEARER string passed via SMTP AUTH.\n>>>> Add support for the same in git-send-email.\n>>>\n>>> The proposed log message should answer these questions as well:\n>>>\n>>>   What happens with version before 2.2000?  Is it safe to\n>>>   unconditionally add parameters like this patch does, and why?\n>>\n>> It's safe to add parameters unconditionally because the library\n>> will simply reject them without any error. It's basically like\n>> declaring a variable and not using it anywhere for older\n>> versions. I have tested this with old libraries as well.\n>>\n>> Consider the fact that the authname variable is also not in every\n>> authentication method used by Authen SASL, still its declared\n>> unconditionally before.\n> \n> These are good to have in the proposed log message.\n\nWill send a v2\n\nCheers!\n"},{"id":"537983","messageId":"MAUPR01MB1154634CC04D29AAF7CADE5F7B87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM","threadId":"65139","inReplyTo":"MAUPR01MB11546AED093D8641767AACEFCB87DA@MAUPR01MB11546.INDPRD01.PROD.OUTLOOK.COM","subject":"[PATCH v2] send-email: pass smtp hostname and port to Authen::SASL","fromName":"Aditya Garg","fromEmail":"gargaditya08@live.com","sentAt":"2026-03-05T17:01:15Z","receivedAt":"2026-03-05T17:01:39Z","isPatch":true,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"Starting from version 2.2000, Authen::SASL supports passing the SMTP\nserver hostname and port to the OAUTHBEARER string passed via SMTP AUTH.\nAdd support for the same in git-send-email.\n\nIt's safe to add the new parameters unconditionally as older versions of\nAuthen::SASL will simply ignore them without any error. Something\nsimilar is already being done for the authname parameter, which is not\nsupported by every authentication mechanism. This can be understood as\ndeclaring a variable but not using at all.\n\nLink: https://metacpan.org/pod/Authen::SASL::Perl::OAUTHBEARER\n\nSigned-off-by: Aditya Garg <gargaditya08@live.com>\n---\n git-send-email.perl | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex eed5420882..0ac4d634e8 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1474,6 +1474,8 @@ sub smtp_auth_maybe {\n \t\t\t\t\t\tuser     => $cred->{'username'},\n \t\t\t\t\t\tpass     => $cred->{'password'},\n \t\t\t\t\t\tauthname => $cred->{'username'},\n+\t\t\t\t\t\thost     => $smtp_server,\n+\t\t\t\t\t\t(defined $smtp_server_port ? (port => $smtp_server_port) : ()),\n \t\t\t\t\t}\n \t\t\t\t);\n \t\t\t\t$result = $smtp->auth($sasl);\n\nRange-diff against v1:\n1:  9b48ca57ae ! 1:  5befaa626d send-email: pass smtp hostname and port to Authen::SASL\n    @@ Commit message\n         server hostname and port to the OAUTHBEARER string passed via SMTP AUTH.\n         Add support for the same in git-send-email.\n     \n    +    It's safe to add the new parameters unconditionally as older versions of\n    +    Authen::SASL will simply ignore them without any error. Something\n    +    similar is already being done for the authname parameter, which is not\n    +    supported by every authentication mechanism. This can be understood as\n    +    declaring a variable but not using at all.\n    +\n         Link: https://metacpan.org/pod/Authen::SASL::Perl::OAUTHBEARER\n     \n         Signed-off-by: Aditya Garg <gargaditya08@live.com>\n-- \n2.52.0\n\n"}]}