зеркало из https://github.com/mozilla/pjs.git
Bug 284629 : Combine Param(enable_mail_sending) with Param(maildeliverymethod)
Patch by Shane H. W. Travis <travis@sedsystems.ca> r=Jake a=myk
This commit is contained in:
Родитель
5200e318d8
Коммит
8a5193c361
|
@ -883,17 +883,17 @@ sub NewProcessOnePerson ($$$$$$$$$$$$$) {
|
|||
|
||||
sub MessageToMTA ($) {
|
||||
my ($msg) = (@_);
|
||||
return unless Param('enable_mail_sending');
|
||||
return if (Param('mail_delivery_method') eq "none");
|
||||
|
||||
my @args;
|
||||
if (Param("maildeliverymethod") eq "sendmail" && !Param("sendmailnow")) {
|
||||
if (Param("mail_delivery_method") eq "sendmail" && !Param("sendmailnow")) {
|
||||
push @args, "-ODeliveryMode=deferred";
|
||||
}
|
||||
if (Param("maildeliverymethod") eq "smtp") {
|
||||
if (Param("mail_delivery_method") eq "smtp") {
|
||||
push @args, Server => Param("smtpserver");
|
||||
}
|
||||
my $mailer = new Mail::Mailer Param("maildeliverymethod"), @args;
|
||||
if (Param("maildeliverymethod") eq "testfile") {
|
||||
my $mailer = new Mail::Mailer Param("mail_delivery_method"), @args;
|
||||
if (Param("mail_delivery_method") eq "testfile") {
|
||||
$Mail::Mailer::testfile::config{outfile} = "$datadir/mailer.testfile";
|
||||
}
|
||||
|
||||
|
|
|
@ -1282,10 +1282,10 @@ if (@oldparams) {
|
|||
close PARAMFILE;
|
||||
}
|
||||
|
||||
# Set maildeliverymethod to SMTP and prompt for SMTP server
|
||||
# Set mail_delivery_method 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') {
|
||||
if ($^O =~ /MSWin32/i && Param('mail_delivery_method') 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'}
|
||||
|
@ -1296,7 +1296,7 @@ if ($^O =~ /MSWin32/i && Param('maildeliverymethod') eq 'sendmail') {
|
|||
print "\nWarning: No SMTP Server provided, defaulting to localhost\n";
|
||||
$smtp = 'localhost';
|
||||
}
|
||||
SetParam('maildeliverymethod', 'smtp');
|
||||
SetParam('mail_delivery_method', 'smtp');
|
||||
SetParam('smtpserver', $smtp);
|
||||
}
|
||||
|
||||
|
|
|
@ -671,24 +671,20 @@ sub find_languages {
|
|||
},
|
||||
|
||||
{
|
||||
name => 'enable_mail_sending',
|
||||
desc => 'If set to \'Off\', Bugzilla will not send out any email of any ' .
|
||||
'type whatsoever.<br>For most administrators, it is useful to ' .
|
||||
'be able to disable all mail during testing and initial setup, ' .
|
||||
'but other than that they will want to leave it \'On\'.',
|
||||
type => 'b',
|
||||
default => 1
|
||||
},
|
||||
|
||||
{
|
||||
name => 'maildeliverymethod',
|
||||
desc => 'The method used for mail delivery. The testfile method ' .
|
||||
'is useful for debugging (for more information see the ' .
|
||||
'Mail::Mailer manual)',
|
||||
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>' .
|
||||
'<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>' .
|
||||
'<li>\'none\' will completely disable email. Bugzilla continues ' .
|
||||
'to act as though it is sending mail, but nothing is sent or ' .
|
||||
'stored.</li></ul>' ,
|
||||
type => 's',
|
||||
choices => $^O =~ /MSWin32/i
|
||||
? ['smtp', 'testfile']
|
||||
: ['sendmail', 'smtp', 'qmail', 'testfile'],
|
||||
? ['smtp', 'testfile', 'none']
|
||||
: ['sendmail', 'smtp', 'qmail', 'testfile', 'none'],
|
||||
default => 'sendmail',
|
||||
checker => \&check_multi
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче