summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-08-16 02:56:16 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2011-08-16 02:56:16 +0200
commitd9a3904454980dd10f5fddd973e254ab138764b6 (patch)
treefa6809d2100a2fa7612cec44dfb330194c112c70
parent3a8142ae9f3cd14b6ca54c6db6f6f07fb9025fe8 (diff)
downloadbugzilla-d9a3904454980dd10f5fddd973e254ab138764b6.tar.gz
bugzilla-d9a3904454980dd10f5fddd973e254ab138764b6.tar.xz
Bug 466419: Add SSL support for SMTP
r/a=mkanat
-rw-r--r--Bugzilla/Config/Common.pm10
-rw-r--r--Bugzilla/Config/MTA.pm6
-rw-r--r--Bugzilla/Install/Requirements.pm6
-rw-r--r--Bugzilla/Mailer.pm1
-rw-r--r--template/en/default/admin/params/mta.html.tmpl2
-rw-r--r--template/en/default/setup/strings.txt.pl1
6 files changed, 25 insertions, 1 deletions
diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm
index 9fffe02ee..17505079f 100644
--- a/Bugzilla/Config/Common.pm
+++ b/Bugzilla/Config/Common.pm
@@ -51,7 +51,7 @@ use base qw(Exporter);
check_user_verify_class
check_mail_delivery_method check_notification check_utf8
check_bug_status check_smtp_auth check_theschwartz_available
- check_maxattachmentsize check_email
+ check_maxattachmentsize check_email check_smtp_ssl
);
# Checking functions for the various values
@@ -350,6 +350,14 @@ sub check_smtp_auth {
return "";
}
+sub check_smtp_ssl {
+ my $use_ssl = shift;
+ if ($use_ssl && !Bugzilla->feature('smtp_ssl')) {
+ return "SSL support is not available. Run checksetup.pl for more details";
+ }
+ return "";
+}
+
sub check_theschwartz_available {
my $use_queue = shift;
if ($use_queue && !Bugzilla->feature('jobqueue')) {
diff --git a/Bugzilla/Config/MTA.pm b/Bugzilla/Config/MTA.pm
index c90e5dc76..b9b25bc6f 100644
--- a/Bugzilla/Config/MTA.pm
+++ b/Bugzilla/Config/MTA.pm
@@ -81,6 +81,12 @@ sub get_param_list {
default => ''
},
{
+ name => 'smtp_ssl',
+ type => 'b',
+ default => 0,
+ checker => \&check_smtp_ssl
+ },
+ {
name => 'smtp_debug',
type => 'b',
default => 0
diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm
index d8119f1b0..ab696e235 100644
--- a/Bugzilla/Install/Requirements.pm
+++ b/Bugzilla/Install/Requirements.pm
@@ -261,6 +261,12 @@ sub OPTIONAL_MODULES {
feature => ['smtp_auth'],
},
{
+ package => 'Net-SMTP-SSL',
+ module => 'Net::SMTP::SSL',
+ version => 1.01,
+ feature => ['smtp_ssl'],
+ },
+ {
package => 'RadiusPerl',
module => 'Authen::Radius',
version => 0,
diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm
index 5ee6fd2eb..699467ed8 100644
--- a/Bugzilla/Mailer.pm
+++ b/Bugzilla/Mailer.pm
@@ -164,6 +164,7 @@ sub MessageToMTA {
username => Bugzilla->params->{"smtp_username"},
password => Bugzilla->params->{"smtp_password"},
Hello => $hostname,
+ ssl => Bugzilla->params->{'smtp_ssl'},
Debug => Bugzilla->params->{'smtp_debug'};
}
diff --git a/template/en/default/admin/params/mta.html.tmpl b/template/en/default/admin/params/mta.html.tmpl
index 05c44853e..b4826e401 100644
--- a/template/en/default/admin/params/mta.html.tmpl
+++ b/template/en/default/admin/params/mta.html.tmpl
@@ -63,6 +63,8 @@
smtp_password => "The password to pass to the SMTP server for SMTP authentication. " _
"This field has no effect if the smtp_username parameter is left empty.",
+ smtp_ssl => "Enable SSL support for SMTP.",
+
smtp_debug => "If enabled, this will print detailed information to your" _
" web server's error log about the communication between" _
" $terms.Bugzilla and your SMTP server. You can use this to" _
diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl
index 0bf3bdd7c..bbc188efb 100644
--- a/template/en/default/setup/strings.txt.pl
+++ b/template/en/default/setup/strings.txt.pl
@@ -106,6 +106,7 @@ END
feature_moving => 'Move Bugs Between Installations',
feature_patch_viewer => 'Patch Viewer',
feature_smtp_auth => 'SMTP Authentication',
+ feature_smtp_ssl => 'SSL Support for SMTP',
feature_updates => 'Automatic Update Notifications',
feature_xmlrpc => 'XML-RPC Interface',
feature_detect_charset => 'Automatic charset detection for text attachments',