Your home directory is mounted over NFS and exists on both the mail and the web machine. You can process mail through programs which exist in your home directory (though problems could come up if a program called other stuff that lived on the user machine but that wasn't installed on the mail machine).
In general, we try to keep a fairly consistent environment in terms of perl modules, python version, etc., so that in most cases, processing stuff on the mail machines should work pretty much the same as doing it on the user machines.
Well I don't know a lot about PHP, but it's mostly designed for doing web application type stuff, no? Most people that process mail seem to use Perl or python. I definitely know people who have used PHP to do this sort of thing, so I imagine it will more or less work.