aboutsummaryrefslogtreecommitdiffstats
path: root/config/mailreport
diff options
context:
space:
mode:
Diffstat (limited to 'config/mailreport')
-rw-r--r--config/mailreport/mail_reports.inc15
-rw-r--r--config/mailreport/mailreport.xml30
-rw-r--r--config/mailreport/status_mail_report.php22
-rw-r--r--config/mailreport/status_mail_report_add_cmd.php6
-rw-r--r--config/mailreport/status_mail_report_add_graph.php6
-rw-r--r--config/mailreport/status_mail_report_add_log.php6
-rw-r--r--config/mailreport/status_mail_report_edit.php10
7 files changed, 48 insertions, 47 deletions
diff --git a/config/mailreport/mail_reports.inc b/config/mailreport/mail_reports.inc
index cf8c837c..aa2bc3ce 100644
--- a/config/mailreport/mail_reports.inc
+++ b/config/mailreport/mail_reports.inc
@@ -194,11 +194,13 @@ function mail_report_send($headertext, $cmdtext, $logtext, $attachments) {
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = $config['notifications']['smtp']['ipaddress'];
+ $mail->Port = empty($config['notifications']['smtp']['port']) ? 25 : $config['notifications']['smtp']['port'];
- if ($config['notifications']['smtp']['ssl'] == "checked")
+ if ((isset($config['notifications']['smtp']['ssl']) && $config['notifications']['smtp']['ssl'] != "unchecked") || $config['notifications']['smtp']['ssl'] == "checked")
$mail->SMTPSecure = "ssl";
- $mail->Port = empty($config['notifications']['smtp']['port']) ? 25 : $config['notifications']['smtp']['port'];
+ if ((isset($config['notifications']['smtp']['tls']) && $config['notifications']['smtp']['tls'] != "unchecked") || $config['notifications']['smtp']['tls'] == "checked")
+ $mail->SMTPSecure = "tls";
if($config['notifications']['smtp']['username'] &&
$config['notifications']['smtp']['password']) {
@@ -209,11 +211,11 @@ function mail_report_send($headertext, $cmdtext, $logtext, $attachments) {
$mail->ContentType = 'text/html';
$mail->IsHTML(true);
- $mail->AddReplyTo($config['notifications']['smtp']['fromaddress'], "Firewall Graph Report");
- $mail->SetFrom($config['notifications']['smtp']['fromaddress'], "Firewall Graph Report");
+ $mail->AddReplyTo($config['notifications']['smtp']['fromaddress'], "Firewall Email Report");
+ $mail->SetFrom($config['notifications']['smtp']['fromaddress'], "Firewall Email Report");
$address = $config['notifications']['smtp']['notifyemailaddress'];
$mail->AddAddress($address, "Report Recipient");
- $mail->Subject = "{$config['system']['hostname']}.{$config['system']['domain']} Graph Report: {$headertext}";
+ $mail->Subject = "{$config['system']['hostname']}.{$config['system']['domain']} Email Report: {$headertext}";
$mail->Body .= "This is a periodic report from your firewall, {$config['system']['hostname']}.{$config['system']['domain']}.<br /><br />Current report: {$headertext}<br />\n<br />\n";
if (!empty($cmdtext))
$mail->Body .= $cmdtext;
@@ -1232,8 +1234,7 @@ function mail_report_get_log($logfile, $tail, $grepfor) {
$logarr = "";
$grepline = " ";
if(is_array($grepfor))
- foreach($grepfor as $agrep)
- $grepline .= " | grep \"$agrep\"";
+ $grepline = " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
if($config['system']['disablesyslogclog']) {
exec("cat {$logfile}{$grepline} | /usr/bin/tail -n {$tail}", $logarr);
} else {
diff --git a/config/mailreport/mailreport.xml b/config/mailreport/mailreport.xml
index 3b926753..fe0b98b6 100644
--- a/config/mailreport/mailreport.xml
+++ b/config/mailreport/mailreport.xml
@@ -37,52 +37,52 @@
]]>
</copyright>
<name>mailreport</name>
- <version>2.0.7</version>
- <title>Status: Mail Reports</title>
+ <version>2.0.10</version>
+ <title>Status: Email Reports</title>
<additional_files_needed>
<prefix>/usr/local/bin/</prefix>
<chmod>0755</chmod>
- <item>http://www.pfsense.com/packages/config/mailreport/mail_reports_generate.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/mail_reports_generate.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/etc/inc/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/mail_reports.inc</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/mail_reports.inc</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/etc/inc/phpmailer/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/class.phpmailer.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/class.phpmailer.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/etc/inc/phpmailer/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/class.pop3.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/class.pop3.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/etc/inc/phpmailer/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/class.smtp.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/class.smtp.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/status_mail_report.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/status_mail_report.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/status_mail_report_edit.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/status_mail_report_edit.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/status_mail_report_add_cmd.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/status_mail_report_add_cmd.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/status_mail_report_add_log.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/status_mail_report_add_log.php</item>
</additional_files_needed>
<additional_files_needed>
<prefix>/usr/local/www/</prefix>
- <item>http://www.pfsense.com/packages/config/mailreport/status_mail_report_add_graph.php</item>
+ <item>https://packages.pfsense.org/packages/config/mailreport/status_mail_report_add_graph.php</item>
</additional_files_needed>
<menu>
- <name>E-Mail Reports</name>
- <tooltiptext>Setup periodic e-mail reports.</tooltiptext>
+ <name>Email Reports</name>
+ <tooltiptext>Setup periodic email reports.</tooltiptext>
<section>Status</section>
<url>/status_mail_report.php</url>
</menu>
@@ -101,4 +101,4 @@
exec("rm /usr/local/www/status_mail_report_add_graph.php");
]]>
</custom_php_deinstall_command>
-</packagegui> \ No newline at end of file
+</packagegui>
diff --git a/config/mailreport/status_mail_report.php b/config/mailreport/status_mail_report.php
index e08a7272..b530587f 100644
--- a/config/mailreport/status_mail_report.php
+++ b/config/mailreport/status_mail_report.php
@@ -33,8 +33,8 @@
##|+PRIV
##|*IDENT=page-status-mailreports
-##|*NAME=Status: E-Mail Reports page
-##|*DESCR=Allow access to the 'Status: E-Mail Reports' page.
+##|*NAME=Status: Email Reports page
+##|*DESCR=Allow access to the 'Status: Email Reports' page.
##|*MATCH=status_mail_report.php*
##|-PRIV
@@ -54,14 +54,14 @@ if ($_GET['act'] == "del") {
// Fix up cron job(s)
set_mail_report_cron_jobs($a_mailreports);
- write_config("Removed Mail Report '{$name}'");
+ write_config("Removed Email Report '{$name}'");
configure_cron();
header("Location: status_mail_report.php");
exit;
}
}
-$pgtitle = array(gettext("Status"),gettext("Mail Reports"));
+$pgtitle = array(gettext("Status"),gettext("Email Reports"));
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
@@ -69,15 +69,15 @@ include("head.inc");
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td><div id="mainarea">
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td colspan="4">Here you can define a list of reports to be sent by e-mail. </td></tr>
+ <tr><td colspan="4">Here you can define a list of reports to be sent by email. </td></tr>
<tr><td>&nbsp;</td></tr>
<tr>
- <td width="35%" class="listhdr"><?=gettext("Description");?></td>
- <td width="25%" class="listhdr"><?=gettext("Schedule");?></td>
- <td width="10%" class="listhdr"><?=gettext("Cmds");?></td>
- <td width="10%" class="listhdr"><?=gettext("Logs");?></td>
- <td width="10%" class="listhdr"><?=gettext("Graphs");?></td>
- <td width="10%" class="list"><a href="status_mail_report_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
+ <td width="34%" class="listhdr"><?=gettext("Description");?></td>
+ <td width="24%" class="listhdr"><?=gettext("Schedule");?></td>
+ <td width="12%" class="listhdr"><?=gettext("Commands");?></td>
+ <td width="12%" class="listhdr"><?=gettext("Logs");?></td>
+ <td width="12%" class="listhdr"><?=gettext("Graphs");?></td>
+ <td width="6%" class="list"><a href="status_mail_report_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
</tr>
<?php $i = 0; foreach ($a_mailreports as $mailreport): ?>
<tr ondblclick="document.location='status_mail_report_edit.php?id=<?=$i;?>'">
diff --git a/config/mailreport/status_mail_report_add_cmd.php b/config/mailreport/status_mail_report_add_cmd.php
index b4527584..6a924142 100644
--- a/config/mailreport/status_mail_report_add_cmd.php
+++ b/config/mailreport/status_mail_report_add_cmd.php
@@ -34,8 +34,8 @@
##|+PRIV
##|*IDENT=page-status-mailreportsaddcmd
-##|*NAME=Status: E-Mail Reports: Add Command page
-##|*DESCR=Allow access to the 'Status: E-Mail Reports: Add Command' page.
+##|*NAME=Status: Email Reports: Add Command page
+##|*DESCR=Allow access to the 'Status: Email Reports: Add Command' page.
##|*MATCH=status_mail_report_add_cmd.php*
##|-PRIV
@@ -89,7 +89,7 @@ if ($_POST) {
}
-$pgtitle = array(gettext("Status"),gettext("Add Mail Report Command"));
+$pgtitle = array(gettext("Status"),gettext("Add Email Report Command"));
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
diff --git a/config/mailreport/status_mail_report_add_graph.php b/config/mailreport/status_mail_report_add_graph.php
index 663d8f9b..3f629d56 100644
--- a/config/mailreport/status_mail_report_add_graph.php
+++ b/config/mailreport/status_mail_report_add_graph.php
@@ -34,8 +34,8 @@
##|+PRIV
##|*IDENT=page-status-mailreportsaddgraph
-##|*NAME=Status: E-Mail Reports: Add Graph page
-##|*DESCR=Allow access to the 'Status: E-Mail Reports: Add Graph' page.
+##|*NAME=Status: Email Reports: Add Graph page
+##|*DESCR=Allow access to the 'Status: Email Reports: Add Graph' page.
##|*MATCH=status_mail_report_add_graph.php*
##|-PRIV
@@ -158,7 +158,7 @@ if ($_POST) {
}
-$pgtitle = array(gettext("Status"),gettext("Add Mail Report Graph"));
+$pgtitle = array(gettext("Status"),gettext("Add Email Report Graph"));
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
diff --git a/config/mailreport/status_mail_report_add_log.php b/config/mailreport/status_mail_report_add_log.php
index 0b140723..83786994 100644
--- a/config/mailreport/status_mail_report_add_log.php
+++ b/config/mailreport/status_mail_report_add_log.php
@@ -34,8 +34,8 @@
##|+PRIV
##|*IDENT=page-status-mailreportsaddlog
-##|*NAME=Status: E-Mail Reports: Add Log page
-##|*DESCR=Allow access to the 'Status: E-Mail Reports: Add Log' page.
+##|*NAME=Status: Email Reports: Add Log page
+##|*DESCR=Allow access to the 'Status: Email Reports: Add Log' page.
##|*MATCH=status_mail_report_add_log.php*
##|-PRIV
@@ -95,7 +95,7 @@ if ($_POST) {
}
-$pgtitle = array(gettext("Status"),gettext("Add Mail Report Log"));
+$pgtitle = array(gettext("Status"),gettext("Add Email Report Log"));
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
diff --git a/config/mailreport/status_mail_report_edit.php b/config/mailreport/status_mail_report_edit.php
index 0baa9aa6..e51a4fc6 100644
--- a/config/mailreport/status_mail_report_edit.php
+++ b/config/mailreport/status_mail_report_edit.php
@@ -33,8 +33,8 @@
##|+PRIV
##|*IDENT=page-status-mailreportsedit
-##|*NAME=Status: E-Mail Reports: Edit Report page
-##|*DESCR=Allow access to the 'Status: E-Mail Reports: Edit Report' page.
+##|*NAME=Status: Email Reports: Edit Report page
+##|*DESCR=Allow access to the 'Status: Email Reports: Edit Report' page.
##|*MATCH=status_mail_report_edit.php*
##|-PRIV
@@ -178,7 +178,7 @@ if ($_POST) {
if ($pconfig['frequency'] == "yearly") {
$pconfig['monthofyear'] = isset($pconfig['monthofyear']) ? $pconfig['monthofyear'] : 1;
$friendly = "Yearly, on day {$pconfig['dayofmonth']} of {$monthofyear[$pconfig['monthofyear']]} at {$friendlytime}";
- } else {
+ } elseif ($pconfig['frequency'] != "quarterly") {
if (isset($pconfig['monthofyear']))
unset($pconfig['monthofyear']);
}
@@ -203,7 +203,7 @@ if ($_POST) {
return;
}
-$pgtitle = array(gettext("Status"),gettext("Edit Mail Reports"));
+$pgtitle = array(gettext("Status"),gettext("Edit Email Reports"));
include("head.inc");
?>
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
@@ -235,7 +235,7 @@ include("head.inc");
<option value="<?php echo $freq; ?>" <?php if($pconfig["frequency"] === $freq) echo "selected"; ?>><?php echo ucwords($freq); ?></option>
<?php endforeach; ?>
</select>
- <br/>Select the frequency for the report to be sent via e-mail.
+ <br/>Select the frequency for the report to be sent via email.
<br/>
</td>
<td></td>