Is it possible to filter all outgoing mail generated by Perl scripts, or remove the ability for Perl to send mail all together?
I’ve accomplished something similar with PHP as noted in
Log all outgoing mail created by php. This is just a wrapper around sendmail, but works very well.
My system is Ubuntu 10.04 LTS with Postfix and Perl v5.10.1
You are securing the wrong point. Oh, and your php solution won’t work for even all the common places anyway.
You can send mail by (at least):
Your php solution catches only one of those.
So – what you want to do is:
You can now easily verify who is sending spam from your mail-logs and disable their outgoing mail too.
That still doesn’t stop someone sending mail out via a HTTP service, but then stopping spam becomes the problem of whoever is providing that service.