Is there a better way to do this? I thought it might be possible to explout the replication log for this, but I don't really know where to start...
I think you can use STATUS calls to get enough information you need?. STATUS INBOX (messages uidnext uidvalidity unseen highestmodseq)
Rob
