]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 466419: Add SSL support for SMTP
authorFrédéric Buclin <LpSolit@gmail.com>
Tue, 16 Aug 2011 00:56:16 +0000 (02:56 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 16 Aug 2011 00:56:16 +0000 (02:56 +0200)
r/a=mkanat

Bugzilla/Config/Common.pm
Bugzilla/Config/MTA.pm
Bugzilla/Install/Requirements.pm
Bugzilla/Mailer.pm
template/en/default/admin/params/mta.html.tmpl
template/en/default/setup/strings.txt.pl

index 9fffe02ee05cfcbe7d5904eb74a36a0724465768..17505079fac4c8e8a4dda5863ab85a3eff3044aa 100644 (file)
@@ -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')) {
index c90e5dc763724e3f19f3c5c4b7ce6787cf3555a0..b9b25bc6ff2ab944400e9387873e307952424c05 100644 (file)
@@ -80,6 +80,12 @@ sub get_param_list {
    type => 'p',
    default => ''
   },
+  {
+   name => 'smtp_ssl',
+   type => 'b',
+   default => 0,
+   checker => \&check_smtp_ssl
+  },
   {
    name => 'smtp_debug',
    type => 'b',
index d8119f1b05584ab254fe322ea16c9d2091a09631..ab696e2353b8fe897e0ae986d7a372f74fd1ab80 100644 (file)
@@ -260,6 +260,12 @@ sub OPTIONAL_MODULES {
         version => 0,
         feature => ['smtp_auth'],
     },
+    {
+        package => 'Net-SMTP-SSL',
+        module  => 'Net::SMTP::SSL',
+        version => 1.01,
+        feature => ['smtp_ssl'],
+    },
     {
         package => 'RadiusPerl',
         module  => 'Authen::Radius',
index 5ee6fd2eb854db79d682a55d569c2e1b050d22da..699467ed8ed67dc84c5ec83175ab22ea0ad03792 100644 (file)
@@ -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'};
     }
 
index 05c44853e2ab14ac9061f1699e4db78b2cb3e3c4..b4826e401c7f6175de699d6bb5d3e35a2a7fd445 100644 (file)
@@ -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" _
index 0bf3bdd7cb215ca1d3b57e107edba5cb6cd8c13a..bbc188efb438ff90b2f187a76867c368cfaf9841 100644 (file)
@@ -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',