Based on an onld article written in 2002 at evolt.org that explains how to pipe an email to a php script. Various components of the email are converted to variables for further use.

This should work with any php CGI build. View the Full Story for more info