From 2d74f1cf28a734fe1880dce7638bc1cbab558ab8 Mon Sep 17 00:00:00 2001 From: "Albert S. Causing" Date: Wed, 16 Mar 2011 15:31:22 +0800 Subject: [PATCH] Add support for TLS/SSL for notification (tested with smtp.gmail.com port 465) --- etc/inc/notices.inc | 2 +- usr/local/www/system_advanced_notifications.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index 0cbf5fd293..a5ccc7ba62 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -295,7 +295,7 @@ function notify_via_smtp($message) { $smtp->host_port = empty($config['notifications']['smtp']['port']) ? 25 : $config['notifications']['smtp']['port']; $smtp->direct_delivery = 0; - $smtp->ssl = 0; + $smtp->ssl = ($config['notifications']['smtp']['ssl'] == "checked") ? 1 : 0; $smtp->debug = 0; $smtp->html_debug = 0; $smtp->localhost=$config['system']['hostname'].".".$config['system']['domain']; diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php index c914d7aca0..7da289ab5c 100644 --- a/usr/local/www/system_advanced_notifications.php +++ b/usr/local/www/system_advanced_notifications.php @@ -62,6 +62,8 @@ if($config['notifications']['smtp']['ipaddress']) $pconfig['smtpipaddress'] = $config['notifications']['smtp']['ipaddress']; if($config['notifications']['smtp']['port']) $pconfig['smtpport'] = $config['notifications']['smtp']['port']; +if($config['notifications']['smtp']['ssl']) + $pconfig['smtpssl'] = $config['notifications']['smtp']['ssl']; if($config['notifications']['smtp']['notifyemailaddress']) $pconfig['smtpnotifyemailaddress'] = $config['notifications']['smtp']['notifyemailaddress']; if($config['notifications']['smtp']['username']) @@ -100,6 +102,7 @@ if ($_POST) { // SMTP $config['notifications']['smtp']['ipaddress'] = $_POST['smtpipaddress']; $config['notifications']['smtp']['port'] = $_POST['smtpport']; + $config['notifications']['smtp']['ssl'] = isset($_POST['smtpssl']) ? 'checked' : 'unchecked'; $config['notifications']['smtp']['notifyemailaddress'] = $_POST['smtpnotifyemailaddress']; $config['notifications']['smtp']['username'] = $_POST['smtpusername']; $config['notifications']['smtp']['password'] = $_POST['smtppassword']; @@ -208,8 +211,9 @@ include("head.inc"); - '>
- + '> + >Enable SSL/TLS Authentication
+