Symptoms
After migrating accounts, email addresses may continue to connect to the source server's CardDav port. If the source server is offline, Roundcube cannot load when logging in with an email address.
Cause
After an account is transferred, its Roundcube databases may still reference the source server in the carddav_addressbooks and carddav_accounts tables. Once the old server is taken offline, email accounts will no longer be able to log in to Roundcube.
Resolution
We've opened an internal case for our development team to investigate this further. For reference, the case number is CPANEL-48012. Follow this article to receive an email notification when a solution is published in the product.
This can be repaired by manually updating the url column in the email account's Roundcube SQLite database. This procedure can be run either on the destination server after the account has been migrated, or on the source server before the account is moved:
Grab the current URL in the SQLite database for the
carddav_addressbookstable by running the following command:# sqlite3 /home/CPUSER/etc/DOMAIN.TLD/EMAIL.rcube.db 'select url from carddav_addressbooks;' | awk -F'[/:]' '{print $4}'
Note: In the above command, you need to replace "CPUSER" with the cPanel username, "DOMAIN.TLD" with the domain name, and "EMAIL" with the email account's username (without the domain).
Update the URL in the
carddav_addressbookstable so it references 127.0.0.1 instead of the old hostname by running the following command:# OLD_HOSTNAME=INSERT_YOUR_OLD_HOSTNAME_HERE ; sqlite3 /home/CPUSER/etc/DOMAIN.TLD/EMAIL.rcube.db "update carddav_addressbooks set url = REPLACE(url, '${OLD_HOSTNAME}', '127.0.0.1') where url like '%${OLD_HOSTNAME}%' ;"
Note: In the above command, you will want to replace "INSERT_YOUR_OLD_HOSTNAME_HERE" with the URL provided by the command in step 1, and you will need to replace "CPUSER" with the cPanel username, "DOMAIN.TLD" with the domain, and "EMAIL" with the email account's username(without the domain).
The above steps must be performed for each affected email account.
The carddav_accounts table may also need to be updated with the above command if it exists and references the old hostname. This table may not exist, and that's fine. If the table does not exist or references 127.0.0.1, the steps provided below can be ignored.
Grab the current URL in the SQLite database for the "carddav_accounts" table by running the following command:
# sqlite3 /home/CPUSER/etc/DOMAIN.TLD/EMAIL.rcube.db 'select discovery_url from carddav_accounts;' | awk -F'[/:]' '{print $4}'
Note: In the above command, you will need to replace "CPUSER" with the cPanel username, "DOMAIN.TLD" with the domain name, and "EMAIL" with the email account's username (without the domain).
Update the URL in the
carddav_accountstable so it references 127.0.0.1 instead of the hostname by running the following command:# OLD_HOSTNAME=INSERT_YOUR_OLD_HOSTNAME_HERE ; sqlite3 /home/CPUSER/etc/DOMAIN.TLD/EMAIL.rcube.db "update carddav_accounts set discovery_url = REPLACE(discovery_url, '${OLD_HOSTNAME}', '127.0.0.1') where discovery_url like '%${OLD_HOSTNAME}%' ;"
Note: In the above command, you will want to replace "INSERT_YOUR_OLD_HOSTNAME_HERE" with the URL provided by the command in step 1, and you will need to replace "CPUSER" with the cPanel username, "DOMAIN.TLD" with the domain, and "EMAIL" with the email account's username(without the domain).
Comments
1 comment
Update: CPANEL-48012 is solved in the following cPanel & WHM version(s) and newer:
Article is closed for comments.