I used to pipe incoming emails using:
|/path/to/php/script in .forward file at /home folder.
But the actual system I'm working on is based on Maìldir instead MBOX. So that solution does not work.
I have no clue how to pipe emails correctly to PHP.