Skip to content

Commit 1a741bf

Browse files
bk2204gitster
authored andcommitted
send-email: provide port separately from hostname
If the SMTP port is provided as part of the hostname to Net::SMTP, it passes the combined string to the SASL provider; this causes GSSAPI authentication to fail since Kerberos does not want the port information. Instead, pass the port as a separate argument as is done for SSL connections. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 81a199b commit 1a741bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git-send-email.perl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,9 +1199,11 @@ sub send_message {
11991199
else {
12001200
require Net::SMTP;
12011201
$smtp_domain ||= maildomain();
1202-
$smtp ||= Net::SMTP->new(smtp_host_string(),
1202+
$smtp_server_port ||= 25;
1203+
$smtp ||= Net::SMTP->new($smtp_server,
12031204
Hello => $smtp_domain,
1204-
Debug => $debug_net_smtp);
1205+
Debug => $debug_net_smtp,
1206+
Port => $smtp_server_port);
12051207
if ($smtp_encryption eq 'tls' && $smtp) {
12061208
require Net::SMTP::SSL;
12071209
$smtp->command('STARTTLS');

0 commit comments

Comments
 (0)