Oh, that's much easier, just make an alias to send these messages out from (say your sending them from
[email protected]):
webmailer: "| /path/to/your/script.php"
and run exim -bi
Make sure your script has #!/path/to/php as the first line, and is executable, and take STDIN as the $email_message, and parse accordingly.
Perl would probably be a better choice for this type of application, but eh.