Sync User to cPanel webmail?

You would have to write this from scratch but it is entirely possible.

cPanel webmail is already configured to work with Horde, Roundcube and SquirrelMail which are all open source and very well documented. The main issue that wouldn’t make it seamless is that cPanel uses exim4 as an email server and there would be no way to map the WordPress username and password info with the server authentication. This means they would have to be logged into both WP and cPanel.

Roundcube is better documented than SquirrelMail and you could probably work with the api and include the necessary code using includes from WordPress.

If you wanted to sync the user info you would need to install dovecot and postfix which can use virtual users that are mapped to mailboxes via a mysql database. You could just change the mappings to the WordPress database.

I’m writing a plugin for a client that will administer the email server from the WordPress dashboard but email functions aren’t needed. I built the email servers from scratch using this excellent guide.

My plugin will create email accounts for WordPress users and also allow the admin to manage email accounts for the entire domain including non WordPress users. It will also allow the admin to create additional virtual aliases (forwarding email addresses).