Community

Custom URL for Webmail

Ri
Rituraj #1

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!

Sy
Syahran #3

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
Ri
Rituraj #4

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

Sy
Syahran #5

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

Ri
Rituraj #6

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
SS
Sathish Sampath #7

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

jo
josephgodwinke #8

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

Ri
Rituraj #9


I don’t see anything for logs there.

SS
Sathish Sampath #11

Hi josephgodwinke,

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

jo
josephgodwinke #13

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

jo
josephgodwinke #14

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?

Ri
Rituraj #15

jo
josephgodwinke #16

Undo all the rewrites you did for snappymail I see above

Ri
Rituraj #17

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

jo
josephgodwinke #18

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

jo
josephgodwinke #20

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

Ri
Rituraj #21

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

jo
josephgodwinke #22

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)

Sign in to reply