summaryrefslogtreecommitdiffstats
path: root/defparams.pl
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-08-13 23:56:19 +0200
committerlpsolit%gmail.com <>2005-08-13 23:56:19 +0200
commit0b42b63e6eb6e2c91a048ff073574048940215f4 (patch)
treed0c4b4c559420d6ed01947080ebb268f03b8620f /defparams.pl
parentef9cdafcfa56f3f002fc15416641861b9e9e794d (diff)
downloadbugzilla-0b42b63e6eb6e2c91a048ff073574048940215f4.tar.gz
bugzilla-0b42b63e6eb6e2c91a048ff073574048940215f4.tar.xz
Bug 302418: re-enable sendmail support for Windows - Patch by byron jones (glob) <bugzilla@glob.com.au> r=wurblzap a=justdave
Diffstat (limited to 'defparams.pl')
-rw-r--r--defparams.pl20
1 files changed, 17 insertions, 3 deletions
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.<br><ul>' .
'<li>\'sendmail\', \'smtp\' and \'qmail\' are all MTAs. ' .
- '(only SMTP is available in Windows.)</li>' .
+ 'You need to install a third-party sendmail replacement if ' .
+ 'you want to use sendmail on Windows.' .
'<li>\'testfile\' is useful for debugging: all email is stored ' .
'in data/mailer.testfile instead of being sent. For more ' .
'information, see the Mail::Mailer manual.</li>' .
@@ -703,10 +717,10 @@ sub find_languages {
'stored.</li></ul>' ,
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
},
{