I have a centOS server with qmail and I want to set it up so that every time an email is delivered, a php script is run immediately after. I don't need to "forward" the specific message to the php script, just to trigger its execution whenever qmail delivers a message. However, if I could let the script know at least which mailbox received the message, that would be great (I would avoid uselessly checking ALL mailboxes which is what my script currently does)
At the moment I'm accomplishing this by running my php script via a cronjob every minute, but I would like to avoid uselessly running the script when no mail is being received, and to avoid the half-a-minut-average delay.
How do I set up qmail to trigger the execution of a program after delivering a message?