Page 1 of 1

Include Emails with Multiple Recipients in Quarantine Summary

Posted: 20 May 2016 16:05
by j_k
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:

Code: Select all

 ((to_address=%s) OR (to_domain=%s))
Modified:

Code: Select all

 ((to_address LIKE %s) OR (to_domain=%s))
Line 299:
Original:

Code: Select all

    global $sql;
    $result = dbquery(sprintf($sql, quote_smart($to_address), quote_smart($to_domain)));
    $rows = mysql_num_rows($result);
Modified:

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);

Re: Include Emails with Multiple Recipients in Quarantine Summary

Posted: 21 May 2016 08:55
by shawniverson

Re: Include Emails with Multiple Recipients in Quarantine Summary

Posted: 05 Aug 2016 15:56
by cdburgess75
Works Great! thank you.

Re: Include Emails with Multiple Recipients in Quarantine Summary

Posted: 15 Mar 2019 15:09
by cdburgess75
Can't find a way to do this with the new version of EFA.