Merge branch 'bc/send-email-use-port-as-separate-param'
authorJunio C Hamano <gitster@pobox.com>
Mon, 15 Jul 2013 17:28:50 +0000 (10:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Jul 2013 17:28:50 +0000 (10:28 -0700)
Pass port number as a separate argument when send-email initializes
Net::SMTP, instead of as a part of the hostname, i.e. host:port.
This allows GSSAPI codepath to match with the hostname given.

* bc/send-email-use-port-as-separate-param:
send-email: provide port separately from hostname

git-send-email.perl
index ecbf56f693f7049fd87267ec1830f9020e60e720..45c386337777460ed77fd71026fcfca678b18037 100755 (executable)
@@ -1188,9 +1188,11 @@ sub send_message {
                else {
                        require Net::SMTP;
                        $smtp_domain ||= maildomain();
-                       $smtp ||= Net::SMTP->new(smtp_host_string(),
+                       $smtp_server_port ||= 25;
+                       $smtp ||= Net::SMTP->new($smtp_server,
                                                 Hello => $smtp_domain,
-                                                Debug => $debug_net_smtp);
+                                                Debug => $debug_net_smtp,
+                                                Port => $smtp_server_port);
                        if ($smtp_encryption eq 'tls' && $smtp) {
                                require Net::SMTP::SSL;
                                $smtp->command('STARTTLS');