If most of the users do not want to receive a spam report, but some users or some domains wish to have it sent, I have used a following cronjob to have reports sent to specific users:
/etc/cron.daily/custom-spam-report
Make the file executable:
Explanation:
It would be nice to have this feature in the GUI, to have an option to send spam report for some recipients even if it is by default switched off.
/etc/cron.daily/custom-spam-report
Bash:
#!/bin/sh
/usr/bin/pmgqm status -timespan week | awk 'NR>1 {print $3}'|grep -E 'user@domain1.com|domain2.com'|xargs -rn1 /usr/bin/pmgqm send -timespan week -receiver
Make the file executable:
Bash:
chmod +x /etc/cron.daily/custom-spam-report
Explanation:
- pmgqm status prints a list of recipients who have spam in quarantine, the first line is a header and the recipient is in 3rd column
- awk filters out the header line and picks out only recipients
- grep filters only those users or domains who wish to receive a report
- xargs runs the report sending pmgqm send one recipient at a time (-n1) and only if there is at least one recipient (-r)
It would be nice to have this feature in the GUI, to have an option to send spam report for some recipients even if it is by default switched off.