Both Horde and Roundcube are served under special users, cpanelhorde and cpanelroundcube respectively
you can test with something like the following at the top of horde or round cube index.php:
PHP Code:
var_dump(posix_getpwuid(posix_getuid()));
As for getting a definitive cPanel username account, it won't be possible without a custom escalation binary that cpanelhorde or cpanelroundcube can use. This is because the webmail runtime process/environment was designed for the email user, not the cPanel user.
REMOTE_DBOWNER will likely work in most situations; I was merely pointing it out because when you do hit that edge-case there will be no 'work-around' other than the aforementioned escalation binary.
cPanel provides the C code for an escalation binary here (as well, a variant is shipped with cPanel)
As for your last thought, this might actually work given the following:
a) the webmail runtime process has $_ENV["HOME"] which points to the cPanel user's home directory
b) you use your own file and not .cpanel/nvdata/*…something that is readable by cpanelhorde and cpanelroundcube…depending on how you accomplish this, I'm not sure if it's a good idea…that's to say if you simply made your data file world readable, it would expose email/domain info of the users if a vector to the file system becomes available...but it probably could be done such that's not the case.
You mentioned that no one has ssh access, so that helps…but there can be other vectors too. A good mantra is to never but anything of value ( or that could be leveraged in other ways) in a world readable file.