For each message sent to the account, postfix will run your script. Your script can obtain the raw message from stdin.
You'll be pleased to know that the principle for sendmail and qmail configuration is broadly similar and shouldn't require any changes to your script.
Check: http://us3.php.net/imap
If you're not running a pop3d or an imapd - then xirium's way is good - just get postfix to forward to a mail account that runs the script from .forward.
Note: Someone could mailbomb the account with the .forward file and cause your script to be invoked every single time a mail comes in (hence, a little less secure!)
procmail would allow one to pre-process mail and add some rules to prevent dupes and not even forward messages that don't make sense. For example, if you're expecting to receive a ticket ID in the subject and there isn't one, you toss the message rather than forward it. If you get multiple messages with identical contents, you can also toss it. procmail has built-in tests for this sort of thing. A milter or filter could be written to do the same job, but that would apply to all incoming messages unless you jumped through a few hoops and made it pretty smart.
But, a mailbomb would still be a concern just from a raw mail processing speed standpoint. But, Postfix can throttle SMTP servers that are sending faster than a certain rate...so it can be locked down, but you have to address the problems at multiple layers.
That said, any of the solutions given will probably work fine--most of the time the usual spam and AV filtering tools will keep your mail clean enough to just do the simplest thing and fix it if it breaks (possibly by going to more complex solutions).
It would be more awkward to write and more awkward to test but it would definitely be worthwhile for a high volume of messages.
"Procmail can be used to [...] preprocess your mail, start any programs upon mail arrival [...]."
In fact, I'd argue that if you've never written any sort of network client code, writing a POP client is perfect to get you started. It's just that simple.