]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 280778 : remove sendmail and qmail delivery methods on windows
authortravis%sedsystems.ca <>
Tue, 8 Mar 2005 01:52:57 +0000 (01:52 +0000)
committertravis%sedsystems.ca <>
Tue, 8 Mar 2005 01:52:57 +0000 (01:52 +0000)
Patch by byron jones (glob) <bugzilla@glob.com.au>  r=jake  a=justdave

checksetup.pl
defparams.pl

index 99000abc86f612cb57253d18b21b4de1c246b44b..ac60ff63a13e91a8d94695e36036e73313a12c53 100755 (executable)
 # $answer{'ADMIN_PASSWORD'} = 'fooey';
 # $answer{'ADMIN_REALNAME'} = 'Joel Peshkin';
 #
+# $answer{'SMTP_SERVER'} = 'mail.mydomain.net';
+#
 #
 # Note: Only information that supersedes defaults from LocalVar()
 # function calls needs to be specified in this file.
@@ -1280,6 +1282,24 @@ if (@oldparams) {
     close PARAMFILE;
 }
 
+# Set maildeliverymethod to SMTP and prompt for SMTP server
+# if running on Windows and set to sendmail (Mail::Mailer doesn't
+# support sendmail on Windows)
+if ($^O =~ /MSWin32/i && Param('maildeliverymethod') eq 'sendmail') {
+    print "\nBugzilla requires an SMTP server to function on Windows.\n" .
+        "Please enter your SMTP server's hostname: ";
+    my $smtp = $answer{'SMTP_SERVER'} 
+        || ($silent && die("cant preload SMTP_SERVER")) 
+        || <STDIN>;
+    chomp $smtp;
+    if (!$smtp) {
+        print "\nWarning: No SMTP Server provided, defaulting to localhost\n";
+        $smtp = 'localhost';
+    }
+    SetParam('maildeliverymethod', 'smtp');
+    SetParam('smtpserver', $smtp);
+}
+
 # WriteParams will only write out still-valid entries
 WriteParams();
 
index b3ded03f75bedf8b9a8db47ad794e2a520e1c5f5..bcd0507131ecd316366eb1c4f80e886f5159c07e 100644 (file)
@@ -686,7 +686,9 @@ sub find_languages {
            'is useful for debugging (for more information see the ' .
            'Mail::Mailer manual)',
    type => 's',
-   choices => ['sendmail', 'smtp', 'qmail', 'testfile'],
+   choices => $^O =~ /MSWin32/i 
+                  ? ['smtp', 'testfile']
+                  : ['sendmail', 'smtp', 'qmail', 'testfile'],
    default => 'sendmail',
    checker => \&check_multi
   },