I am looking for a way to register a callback which will be called whenever a new email is received. Note that I am not trying to do this with a zimlet, I am talking about
injecting javascript code in the running webapp. Ideally I would also be able to receive meta information about the received email such as the info sent to the chrome notification.

I am very aware that this is a hacky approach and zimlets would be the way to go. Currently this is not feasible though and I would like to experiment a bit
with injection. I am running zimbra within a webview of a c++ app and would like to be able to receive information about new emails in the c++ application context.

If anyone has any suggestions about different approaches that would be welcome as well.

best regards,