feed all or only certain incoming mails to your script - that would work without any inherent polling. Better yet, you could replace
and plug your own stuff right into that. The latter is probably the best solution; if you need some extra help with your mail mangling (unlikely), check out the myriad of