Fix cPanel mail login issue for all mail clients

I had a strange problem this morning with cPanel and WHM where it was letting me log in to "webmail" but it failed to authenticate when I clicked on Roundcube, SquirellMail or Horde. Roundcube gives the error message: Invalid Login.

Strangely the server had managed to assign one of my domain names to the wrong account as I had created a wildcard subdomain under a subdomain of the main account. To fix the problem you can simply edit the /etc/userdomains file through SSH using VI or NANO

vi /etc/userdomains

To check who owns a particular domain you can check using the following command.

/scripts/whoowns yourdomain.com