I think your thinking of the plugin api which doesn't allow you to get data from a third party source it only to code plugins for Roundcube. You need to make a script that checks the imap server for the unread count (the same thing the Roundcube does), maybe check out the Roundcube framework and see about integrating that into your CMS.