From 72306d5a09f96b6ca7ddd4eea757036b5f2c7960 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Thu, 31 Dec 2009 18:00:07 -0500 Subject: Adding smtp auth support for notifications. Requested-by: pmi@bluegrass.net --- usr/local/www/system_advanced_notifications.php | 37 +++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'usr/local/www/system_advanced_notifications.php') diff --git a/usr/local/www/system_advanced_notifications.php b/usr/local/www/system_advanced_notifications.php index 5a53ab2..c9917ce 100644 --- a/usr/local/www/system_advanced_notifications.php +++ b/usr/local/www/system_advanced_notifications.php @@ -51,6 +51,12 @@ if($config['notifications']['smtp']['ipaddress']) $pconfig['smtpipaddress'] = $config['notifications']['smtp']['ipaddress']; if($config['notifications']['smtp']['notifyemailaddress']) $pconfig['smtpnotifyemailaddress'] = $config['notifications']['smtp']['notifyemailaddress']; +if($config['notifications']['smtp']['username']) + $pconfig['smtpusername'] = $config['notifications']['smtp']['username']; +if($config['notifications']['smtp']['password']) + $pconfig['smtppassword'] = $config['notifications']['smtp']['password']; +if($config['notifications']['smtp']['fromaddress']) + $pconfig['smtpfromaddress'] = $config['notifications']['smtp']['fromaddress']; if ($_POST) { @@ -79,12 +85,18 @@ if ($_POST) { // SMTP $config['notifications']['smtp']['ipaddress'] = $_POST['smtpipaddress']; $config['notifications']['smtp']['notifyemailaddress'] = $_POST['smtpnotifyemailaddress']; + $config['notifications']['smtp']['username'] = $_POST['smtpusername']; + $config['notifications']['smtp']['password'] = $_POST['smtppassword']; + $config['notifications']['smtp']['fromaddress'] = $_POST['smtpfromaddress']; write_config(); // Send test message via growl - register_via_growl(); - notify_via_growl("This is a test message form pfSense. It is safe to ignore this message."); + if($config['notifications']['growl']['ipaddress'] && + $config['notifications']['growl']['password'] = $_POST['password']) { + register_via_growl(); + notify_via_growl("This is a test message form pfSense. It is safe to ignore this message."); + } // Send test message via smtp if(file_exists("/var/db/notices_lastmsg.txt")) @@ -164,6 +176,13 @@ include("head.inc"); + From e-mail address + + '>
+ This is the e-mail address that will appear in the from field. + + + Notification E-Mail address '>
@@ -171,6 +190,20 @@ include("head.inc"); + Notification E-Mail auth username (optional) + + '>
+ Enter the e-mail address username for SMTP authentication. + + + + Notification E-Mail auth password + + '>
+ Enter the e-mail address password for SMTP authentication. + + +   -- cgit v1.1