Thread (1 message) 1 message, 1 author, 2016-06-15

Re: t9001 fails because Net::SMTP is missing

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:28
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Johannes Schindelin [off-list ref] writes:
is it unexpected that there are setups which come without Net::SMTP?

-- snip --
* expecting success: git format-patch -n HEAD^1
     git send-email -from="Example [off-list ref]" 
--to=nobody@example.com --smtp-server="$(pwd)/fake.sendmail" ./0001*txt
0001-Second.txt
Can't locate Net/SMTP.pm in @INC (@INC contains: 
Hmm.  Something like this?

-- >8 --
diff --git a/git-send-email.perl b/git-send-email.perl
index 0e368ff..f7af8eb 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -21,7 +21,6 @@ use warnings;
 use Term::ReadLine;
 use Getopt::Long;
 use Data::Dumper;
-use Net::SMTP;
 
 # most mail servers generate the Date: header, but not all...
 $ENV{LC_ALL} = 'C';
@@ -394,6 +393,7 @@ X-Mailer: git-send-email $gitversion
 		print $sm "$header\n$message";
 		close $sm or die $?;
 	} else {
+		use Net::SMTP;
 		$smtp ||= Net::SMTP->new( $smtp_server );
 		$smtp->mail( $from ) or die $smtp->message;
 		$smtp->to( @recipients ) or die $smtp->message;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help