Signed-off-by: Brilliantov Kirill Vladimirovich <[email protected]>
---
git-send-email.perl | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/git-send-email.perl b/git-send-email.perl
index 2016d9c..5345fdb 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -28,6 +28,7 @@ use File::Temp qw/ tempdir tempfile /;
use File::Spec::Functions qw(catfile);
use Error qw(:try);
use Git;
+use File::HomeDir;
Getopt::Long::Configure qw/ pass_through /;
@@ -804,6 +805,23 @@ if (!defined $smtp_server) {
last;
}
}
+
+ if (!defined $smtp_server) {
+ my $mailrc = File::HomeDir->my_home . "/.mailrc";
+ if (-e $mailrc) {
+ open FILE, $mailrc or die "Failed open $mailrc: $!";
+ while (<FILE>) {
+ chomp;
+ if (/set sendmail=.*/) {
+ my @data = split '"';
+ $smtp_server = $data[1];
+ last;
+ }
+ }
+ close FILE;
+ }
+ }
+
$smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*
}
--
1.8.5.2
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html