Custom URL for Webmail

Hey I would like to redirect cyberpanel.domain.com/snappymail to something like webmail.domain.com

Earlier it used to work fine with redirect rules.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$
RewriteRule ^(.*)$ HTTP://cyberpanel/rainloop/$1 [P]

Since when cyberpanel upgraded to Snappymail it doesn’t work and I get the following error:

An error occurred.
Please refresh the page and try again. Error: Failed loading /snappymail/snappymail/v/2.15.3/static/js/min/libs.min.js

Can someone please help me out!

I got exact same problem. Still no solution.
Error 500 on webmail.example1.net - Support and Discussion - CyberPanel Community

Maybe this way can help you

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$
RewriteRule ^(.*)$ HTTP://cyberpanel/$1 [P]
RedirectMatch ^/$ https://webmail.domain.com/snappymail

Just tried it. It redirects me to the Cyberpanel login instead of email.

If you still want to use webmail.domain.com you can then follow the steps below:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.domain.com$
RewriteRule ^(.*)$ http://cyberpanel/snappymail/$1 [P]

after that go to terminal then type the following command:

# cp -r /usr/local/CyberCP/public/snappymail/snappymail/v /usr/local/CyberCP/public/snappymail/snappymail/snappymail/

maybe it’s a temporary solution that can be done so that it can run on webmail.domain.com

This gives the following error as before

An error occurred.
Please refresh the page and try again. Error: Failed loading /snappymail/snappymail/v/2.15.3/static/js/min/libs.min.js

Hi,
Anyone has a solution for this Error: Failed loading /snappymail/snappymail/v/2.15.3/static/js/min/libs.min.js

Hello @zebrando Happy you are here

Go to /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/application.ini:

Under [logs], set enable = On.
Under [logs] you can also change level = 4 to show/hide some messages from the logs.
Under [labs], set use_app_debug_js = On

Post contents of nano /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/logs.
Click F12 to open the console in your browser` and post contents of that log here


I don’t see anything for logs there.

Hi josephgodwinke,

above is the content in /usr/local/lscp/cyberpanel/rainloop/data/data/default/logs

Run nano /snappymail/snappymail/v/2.15.3/static/js/min/libs.min.js post result here

There must be a problem with your installation because that file should be present there

webmail.zebrando.com/:1 Refused to apply style from 'https://webmail.zebrando.com/snappymail/snappymail/v/2.15.3/static/css/app.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
/snappymail/snappymail/v/2.15.3/static/js/libs.js:1          Failed to load resource: the server responded with a status of 404 ()
webmail.zebrando.com/:1 Refused to execute script from 'https://webmail.zebrando.com/snappymail/snappymail/v/2.15.3/static/js/libs.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
(index):73 Uncaught (in promise) Error: Failed loading /snappymail/snappymail/v/2.15.3/static/js/libs.js
    at script.onerror ((index):73:34)
/snappymail/snappymail/v/2.15.3/static/apple-touch-icon.png:1          Failed to load resource: the server responded with a status of 404 ()
manifest.json:1          Failed to load resource: the server responded with a status of 404 ()
manifest.json:2 Manifest: Line: 2, column: 1, Syntax error.
webmail.zebrando.com/:1 Refused to apply style from 'https://webmail.zebrando.com/snappymail/snappymail/v/2.15.3/static/css/app.min.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
manifest.json:1          Failed to load resource: the server responded with a status of 404 ()

How did you manage to change your installation like this?

Undo all the rewrites you did for snappymail I see above

I did them in a trial server so the main server is untouched

Run nano /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/application.ini:

[labs]
imap_folder_list_limit = 0
autocreate_system_folders = On
[logs]
enable = On
level = 4

Post contents of nano /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/logs/log-2022-10-29.txt

Try this version changer and choose v2.15.3

sh <(curl https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/snappymail_v_changer.sh || wget -O - https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/snappymail_v_changer.sh)

Then follow these steps Custom URL for Webmail - #18 by josephgodwinke

I tried to do all that and access webmaill.domain.com but doesn’t look like it logged anything.

I didnt want you to execute an overhaul but here it is:

$ rm -rf /usr/local/CyberCP/public/snappymail
$ sh <(curl https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/snappymail_v_changer.sh || wget -O - https://raw.githubusercontent.com/josephgodwinkimani/cyberpanel-mods/main/snappymail_v_changer.sh)