Include Emails with Multiple Recipients in Quarantine Summary

Report bugs and workarounds
Post Reply
j_k
Posts: 3
Joined: 27 Jan 2016 15:55

Include Emails with Multiple Recipients in Quarantine Summary

Post 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);
cdburgess75
Posts: 49
Joined: 11 Jun 2014 21:43

Re: Include Emails with Multiple Recipients in Quarantine Summary

Post by cdburgess75 »

Works Great! thank you.
cdburgess75
Posts: 49
Joined: 11 Jun 2014 21:43

Re: Include Emails with Multiple Recipients in Quarantine Summary

Post by cdburgess75 »

Can't find a way to do this with the new version of EFA.
Post Reply