Login to /webmail works, clients login fails

itzhero

Active Member
Nov 16, 2008
30
0
56
Email login works perfectly when the user goes to domain.com/webmail. I require them to log in via SSL, so they get the "login with ssl" link that takes them to https://hostname:2096/cpsess...

They see the three email clients, but each and every one of them reports a login failure and users cannot check their email. Ideas as to a setting that might be disabling this?

Logging in by manually entering credientials stil fails in roundcube/squirrelmail

edit: this is only happening to one user account..
 
Last edited:

JaredR.

Well-Known Member
Feb 25, 2010
1,834
24
143
Houston, TX
cPanel Access Level
Root Administrator
First, in the WebHost Manager, click Main >> Server Configuration >> Tweak Settings and click Save without making any changes, to make sure that valid configuration values are written to the php.ini files used by the Webmail clients. Try logging in to see if this has any effect on the problem.

Next, make sure that the user is listed in only one file in /var/cpanel/users:

Code:
# grep $USER /var/cpanel/users/*
The user should be mentioned in only one file. Next, make sure that there is a passwd and shadow file for the domain:

Code:
# ls -alh /$HOME/$USER/etc/$DOMAIN/
View the contents of the domain's passwd and shadow file and make sure that the user is listed in both.

In my examples above, the variables are defined as follows:

  • $HOME = the home directory, usually /home but not always
  • $USER = the cPanel username
  • $DOMAIN = the domain name in question

There can be different reasons for the behavior you described, and we can usually correct this type of issue relatively quickly if you submit a ticket.
 

itzhero

Active Member
Nov 16, 2008
30
0
56
I've done all the above and checked for what should be there. It all matches what you said should be there. Submitting a support ticket! Thank you
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Can you also try running (for anyone in the future who has this issue) the following command:

Code:
/scripts/whoowns domain.com
Above please replace domain.com with the domain name for the account that isn't working. I've seen people manually add a domain to /var/cpanel/users/username file before and it still isn't properly owned, which causes it to fail on the whoowns check for the domain. That's why I always run "/scripts/whoowns domain.com" first before any other commands for a non-working email domain.

Next, if you can post the support ticket ID# here, that would be helpful for us to check what the resolution happened to be.
 

latsyrc

Registered
Nov 18, 2011
1
0
51
cPanel Access Level
DataCenter Provider
I realize this is an older thread, but it was the first one to pop up on most of the searching I did on this issue.

For posterity
Here is what I did to fix it:
From the command line search the file /etc/userdomains for yourdomain.tld

If it returns multiple entries along the lines of:
yourdomain.tld: system
mail.yourdomain.tld: youruser
yourdomain.tld: youruser

just edit the file with your favorite editor and either comment or remove the the line "yourdomain.tld: system"

No other magic required!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
You cannot directly edit /etc/userdomains file without it possibly reverting whenever /scripts/updateuserdomains runs or during certain other processes. As such, this would only be a temporary bandage to an issue with your domain being owned by the wrong user.

If your domain is showing that wrong ownership, first try moving all these files and running /scripts/updateuserdomains afterward:

Code:
mv /etc/userdomains /etc/userdomains.bak
mv /etc/domainusers /etc/domainusers.bak
mv /etc/trueuserdomains /etc/trueuserdomains.bak
Again afterward, then you would run:

Code:
/scripts/updateuserdomains
If the domain is still improperly owned, please go to /var/cpanel/users location and check for the domain name there:

Code:
grep domain.com /var/cpanel/users/*
If it is showing the wrong ownership, remove the domain from the improperly owned file.

Alternatively, if it is showing the wrong ownership due to having previously been the hostname, please go to WHM > Change Hostname and re-change the hostname by following all the steps to do so. Also, go to /var/cpanel/userdata/nobody location and ensure that the domain isn't listed there only the hostname is listed for any files.
 
  • Like
Reactions: Joshinkii

brentc

Member
Jul 20, 2010
19
0
51
I ran /scripts/whoowns $DOMAIN and it returns just a blank line. So, I'm assuming that's not correct. What's the process to now make the domain be owned correctly?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator