Thanks for all the work on this.
I gave it a try by uploading the three files to my /tmp/ dir on my linux server. I set the .sh file to execute, but this is what I got:
root@web1:/tmp# sh mail_content_filters.sh
PHP Warning: Module 'apc' already loaded in Unknown on line 0
PHP Fatal error: Call to a member function quote() on a non-object in /usr/local/ispconfig/interface/lib/classes/db_mysql.inc.php on line 280