From c8c46e5a8e9551db0172b79aae1fee4553b3bf7d Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Thu, 11 Aug 2016 14:38:30 -0300 Subject: Ticket #3734: - Added timeout parameter for SMTP configuration - Removed STARTTLS option, it's enabled automatically by pear-Mail when server supports it --- .../local/www/system_advanced_notifications.php | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'src/usr/local/www') diff --git a/src/usr/local/www/system_advanced_notifications.php b/src/usr/local/www/system_advanced_notifications.php index 36436b2..4b3a1a5 100644 --- a/src/usr/local/www/system_advanced_notifications.php +++ b/src/usr/local/www/system_advanced_notifications.php @@ -62,8 +62,8 @@ if ($config['notifications']['smtp']['port']) { if (isset($config['notifications']['smtp']['ssl'])) { $pconfig['smtpssl'] = true; } -if (isset($config['notifications']['smtp']['tls'])) { - $pconfig['smtptls'] = true; +if (!empty($config['notifications']['smtp']['timeout'])) { + $pconfig['smtptimeout'] = $config['notifications']['smtp']['timeout']; } if ($config['notifications']['smtp']['notifyemailaddress']) { $pconfig['smtpnotifyemailaddress'] = $config['notifications']['smtp']['notifyemailaddress']; @@ -118,12 +118,7 @@ if ($_POST) { unset($config['notifications']['smtp']['ssl']); } - if (isset($_POST['smtptls'])) { - $config['notifications']['smtp']['tls'] = true; - } else { - unset($config['notifications']['smtp']['tls']); - } - + $config['notifications']['smtp']['timeout'] = $_POST['smtptimeout']; $config['notifications']['smtp']['notifyemailaddress'] = $_POST['smtpnotifyemailaddress']; $config['notifications']['smtp']['username'] = $_POST['smtpusername']; @@ -277,6 +272,13 @@ $section->addInput(new Form_Input( ))->setHelp('This is the port of the SMTP E-Mail server, typically 25, 587 '. '(submission) or 465 (smtps).'); +$section->addInput(new Form_Input( + 'smtptimeout', + 'Connection timeout to E-Mail server', + 'number', + $pconfig['smtptimeout'] +))->setHelp('This is how many seconds it will wait for the SMTP server to connect. Default is 20s.'); + $group = new Form_Group('Secure SMTP Connection'); $group->add(new Form_Checkbox( 'smtpssl', @@ -285,13 +287,6 @@ $group->add(new Form_Checkbox( isset($pconfig['smtpssl']) )); -$group->add(new Form_Checkbox( - 'smtptls', - 'Secure STARTTLS', - 'Enable STARTTLS', - isset($pconfig['smtptls']) -)); - $section->add($group); $section->addInput(new Form_Input( -- cgit v1.1