All, does anyone know how I can find out exactly what the iPhone does when it receives an email? I'm not interested in the popping and mail recovery, but what I'd like to know is how does the email app interacts with the OS, what makes it beep and what makes it change/update the Mail icon and, especially, the variables/keys/strings that are associated with the entire process.

I know that this is a long order, but there is method to my madness and a very good reason for this question that will become more apparent -- hopefully -- in a few days if I can ever figure this out.