Introduction
Roundcube can store data in MySQL or SQLite. This guide is how to determine which users have contacts stored in the MySQL system.
Procedure
For a list of email addresses with contact data stored in the roundcube
mysql database:
mysql -s -e "SELECT DISTINCT username FROM users AS u INNER JOIN contacts AS c ON u.user_id = c.user_id ORDER BY SUBSTRING_INDEX(username, '@', -1) ;" roundcube
The above can then be compared to provide a list of cPanel users with Roundcube contacts:
mysql -s -e "SELECT DISTINCT username FROM users AS u INNER JOIN contacts AS c ON u.user_id = c.user_id ORDER BY SUBSTRING_INDEX(username, '@', -1) ;" roundcube | cut -d '@' -f 2 | uniq | while read domain ; do grep $domain /etc/userdomains ; done | cut -d ' ' -f 2 | sort -u