In this tutorial, we will see how to trigger a PHP script each time your web server is receiving some mail.
Why would you want to do that? Well you could want to do that to develop a custom mailing list system, to archive your mail in database, trigger commands in your website by sending mails... your imagination is the limit.
Getting started with a basic Postfix filter
Configuring Postfix