Include Emails with Multiple Recipients in Quarantine Summary
Posted: 20 May 2016 16:05
One of my users pointed out that the quarantine summaries don't list messages where there are multiple recipients. I looked into this, and the mailwatch database's maillog table lists the addresses separated by commas in the 'to_address' field.
I've modified the SQL queries within the quarantine_report.php file to now include these messages (using a LIKE statement with wildcards as opposed to an "=" statement). This file is part of MailWatch, and located (on the EFA system) at '/usr/local/bin/mailwatch/tools/Cron_jobs/'. I'm not familiar with how to contribute this to the MailWatch project, so if someone else does that would be great. If I've invited any problems on my system please let me know too.
Modifications in quarantine_report.php:
Line 200:
Original:
Modified:
Line 299:
Original:
Modified:
I've modified the SQL queries within the quarantine_report.php file to now include these messages (using a LIKE statement with wildcards as opposed to an "=" statement). This file is part of MailWatch, and located (on the EFA system) at '/usr/local/bin/mailwatch/tools/Cron_jobs/'. I'm not familiar with how to contribute this to the MailWatch project, so if someone else does that would be great. If I've invited any problems on my system please let me know too.
Modifications in quarantine_report.php:
Line 200:
Original:
Code: Select all
((to_address=%s) OR (to_domain=%s))
Code: Select all
((to_address LIKE %s) OR (to_domain=%s))
Original:
Code: Select all
global $sql;
$result = dbquery(sprintf($sql, quote_smart($to_address), quote_smart($to_domain)));
$rows = mysql_num_rows($result);
Code: Select all
global $sql;
$to_address = '%' . $to_address . '%';
$result = dbquery(sprintf($sql, quote_smart($to_address), quote_smart($to_domain)));
$rows = mysql_num_rows($result);