summaryrefslogtreecommitdiffstats
path: root/git-send-email.perl
diff options
context:
space:
mode:
authorYakov Lerner <iler.ml@gmail.com>2009-09-26 00:10:21 +0200
committerShawn O. Pearce <spearce@spearce.org>2009-09-26 00:10:59 +0200
commitfb3650ed100a549f80d822f28ccf0f82e9f75f3e (patch)
tree780f6206f5aeaa9edc625d6857488d038829c73e /git-send-email.perl
parentbash: teach 'git checkout' options (diff)
downloadgit-fb3650ed100a549f80d822f28ccf0f82e9f75f3e.tar.xz
git-fb3650ed100a549f80d822f28ccf0f82e9f75f3e.zip
send-email: fix obscure error when encryption=tls and smtp cannot connect
When encryption=tls and we cannot connect to the SMTP server, git-send-email was printing an obtuse perl error: Can't call method "command" on an undefined value at git-send-email line 927. This can occur when smtp host or port is misspelled, or the network is down, and encryption has been set to tls. Instead we expect some familiar "Cannot connect to SERVER:PORT" message. Fix it to print normal "smtp can't connect" diagnostics. Signed-off-by: Yakov Lerner <iler.ml@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to '')
-rwxr-xr-xgit-send-email.perl2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 0700d80afc..dd821f70cd 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -921,7 +921,7 @@ X-Mailer: git-send-email $gitversion
$smtp ||= Net::SMTP->new((defined $smtp_server_port)
? "$smtp_server:$smtp_server_port"
: $smtp_server);
- if ($smtp_encryption eq 'tls') {
+ if ($smtp_encryption eq 'tls' && $smtp) {
require Net::SMTP::SSL;
$smtp->command('STARTTLS');
$smtp->response();