You may get “Internal Server Error” when accessing your emails on CWP. In this guide, we will look at potential fixes for this error.
We may get the cause(s) of this error by looking at the error logs mainly concerned with emails and RoundCube.
Run the following commands to read the logs on the VPS via SSH terminal:
tail /usr/local/cwpsrv/var/services/roundcube/logs/errors.log

tail /var/log/dovecot.log

Updates
Ensure you have the latest version of CWP and RoundCube.
Run the following script to update CWP:
sh /scripts/update_cwp

Run the following script to update RoundCube:
sh /scripts/mail_roundcube_update

Reboot the server after updating RoundCube and CWP.
Permissions
RoundCube may be lacking sufficient permissions to read and write email files and folders.
Run this command to fix the mail permissions:
sh /scripts/cwp_api account mail_fix_permissions
Check and see if the issue has been fixed after running the above command.
To fix the email files and folders permissions and ownership, execute the following commands:
chown vmail.mail /var/vmail
chmod 770 /var/vmail
These are the potential fixes to the error. Always check the error log to get the cause of the problem as it will guide you on how to fix it.