Symptoms
When trying to compose an email and use the auto-complete feature for contacts, you may see an internal server error. The same error occurs if you access Contacts and then click into cPanel CardDav.
Description
The first step here is to tail the user's RoundCube log file by running the following command:
tail -0f /home/USER/logs/roundcube/errors.log
Please note, you need to replace the "USER" variable with the actual cPanel username.
If the error you see is:
Failed connect to domain.tld:2080; Connection refused
then it is likely that the domain doesn't resolve to this server and causes the connection refused error.
Workaround
The mailbox SQLite database will need to be updated to use the server's hostname instead of the domain name in order for the connections to remain locally on this server itself. The email account's RoundCube SQLite database is located at:
/home/USER/etc/DOMAIN/MAILUSER.rcube.db
Please note, you need to replace "USER" with the cPanel username, "DOMAIN" with the domain, and "MAILUSER" with the email account's user.
You would use the following command to access the mailbox via sqlite:
/usr/local/cpanel/3rdparty/bin/sqlite3 /home/USER/etc/DOMAIN/MAILUSER.rcube.db
Please note, you need to replace "USER" with the cPanel username, "DOMAIN" with the domain, and "MAILUSER" with the email account's user.
Then, to change the problematic domain's entries to the server's hostname, you would execute the following SQL statements:
UPDATE carddav_addressbooks SET URL = replace( url, 'DOMAIN.TLD', 'HOSTNAME') WHERE url LIKE '%DOMAIN.TLD%';
UPDATE carddav_accounts SET URL = replace( discovery_url, 'DOMAIN.TLD', 'HOSTNAME') WHERE url LIKE '%DOMAIN.TLD%';
Please note, you need to replace the 2 "DOMAIN.TLD" variables with the domain that isn't resolving and "HOSTNAME" with the server's hostname in both of the above-provided commands.
You can check the results by running:
select * from carddav_addressbooks;
select * from carddav_accounts;
After confirming the change was correct, you can quit the sqlite CLI by entering:
.quit
Next, test RoundCube and the error should be cleared.
Comments
0 comments
Article is closed for comments.