From 0b42b63e6eb6e2c91a048ff073574048940215f4 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 13 Aug 2005 21:56:19 +0000 Subject: Bug 302418: re-enable sendmail support for Windows - Patch by byron jones (glob) r=wurblzap a=justdave --- defparams.pl | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'defparams.pl') diff --git a/defparams.pl b/defparams.pl index d8a7b7e38..598d0711f 100644 --- a/defparams.pl +++ b/defparams.pl @@ -54,6 +54,7 @@ use Socket; use Bugzilla::Config qw(:DEFAULT $templatedir $webdotdir); use Bugzilla::Util; +use Bugzilla::Constants; # Checking functions for the various values # Some generic checking functions are included in Bugzilla::Config @@ -247,6 +248,18 @@ sub find_languages { return join(', ', @languages); } +sub check_mail_delivery_method { + my $check = check_multi(@_); + return $check if $check; + my $mailer = shift; + if ($mailer eq 'sendmail' && $^O =~ /MSWin32/i) { + # look for sendmail.exe + return "Failed to locate " . SENDMAIL_EXE + unless -e SENDMAIL_EXE; + } + return ""; +} + # OK, here are the parameter definitions themselves. # # Each definition is a hash with keys: @@ -694,7 +707,8 @@ sub find_languages { name => 'mail_delivery_method', desc => 'Defines how email is sent, or if it is sent at all.
' , type => 's', choices => $^O =~ /MSWin32/i - ? ['smtp', 'testfile', 'none'] + ? ['smtp', 'testfile', 'sendmail', 'none'] : ['sendmail', 'smtp', 'qmail', 'testfile', 'none'], default => 'sendmail', - checker => \&check_multi + checker => \&check_mail_delivery_method }, { -- cgit v1.2.3-24-g4f1b