notification on failed email parsing

view story

http://serverfault.com – I'm trying to process incoming emails with a PHP script but that script is quite complex and bugs often arise, resulting in unprocessed email. I'd like to get a notification (or at least to be able to log the error to a file) when there is a problem with the processing script. Mail server is postfix and I currently have the following .forward file: [email protected],"|/usr/bin/php /email_processor.php" I'd like to know if there is a way to modify .forward to send notifications/log errors when email_processor.php fails. Thanks! (HowTos)