mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Allow setting the SMTP port for notifications. Fixes #677
This commit is contained in:
parent
f3dc4bf1af
commit
9277b7efaa
@ -291,7 +291,7 @@ function notify_via_smtp($message) {
|
||||
$to = $config['notifications']['smtp']['notifyemailaddress'];
|
||||
|
||||
$smtp->host_name = $config['notifications']['smtp']['ipaddress'];
|
||||
$smtp->host_port = 25;
|
||||
$smtp->host_port = empty($config['notifications']['smtp']['port']) ? 25 : $config['notifications']['smtp']['port'];
|
||||
|
||||
$smtp->direct_delivery = 0;
|
||||
$smtp->ssl = 0;
|
||||
|
||||
@ -60,6 +60,8 @@ else
|
||||
// SMTP
|
||||
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']['notifyemailaddress'])
|
||||
$pconfig['smtpnotifyemailaddress'] = $config['notifications']['smtp']['notifyemailaddress'];
|
||||
if($config['notifications']['smtp']['username'])
|
||||
@ -97,6 +99,7 @@ if ($_POST) {
|
||||
|
||||
// SMTP
|
||||
$config['notifications']['smtp']['ipaddress'] = $_POST['smtpipaddress'];
|
||||
$config['notifications']['smtp']['port'] = $_POST['smtpport'];
|
||||
$config['notifications']['smtp']['notifyemailaddress'] = $_POST['smtpnotifyemailaddress'];
|
||||
$config['notifications']['smtp']['username'] = $_POST['smtpusername'];
|
||||
$config['notifications']['smtp']['password'] = $_POST['smtppassword'];
|
||||
@ -202,6 +205,13 @@ include("head.inc");
|
||||
<?=gettext("This is the IP address of the SMTP E-Mail server that will be used to send notifications to."); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="22%" valign="top" class="vncell"><?=gettext("SMTP Port of E-Mail server"); ?></td>
|
||||
<td width="78%" class="vtable">
|
||||
<input name='smtpport' value='<?php echo $pconfig['smtpport']; ?>'><br/>
|
||||
<?=gettext("This is the port of the SMTP E-Mail server, typically 25 or 587 (submission)."); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="22%" valign="top" class="vncell"><?=gettext("From e-mail address"); ?></td>
|
||||
<td width="78%" class="vtable">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user