Custom URL for Webmail

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)

wait you updated snappymail? so if i run this version update on the server it should work?

Welcome @Murex Happy you are here

if you do not have any technical ability I do not advice you upgrade snappymail if it works perfectly with standard cyberpanel installation.

The upgrade will not cause any issues unless there are unknown issues with latest release. Also I advice my clients not use any latest releases of any software for production.

hello, i’m getting the same issues the OP, and trying to solve it , so far only webmailDOTdomainDOTcom/snappymail redirects properly and i’m trying to remove that last bit , tried another redirect from webmail.domain.com to webmailDOTdomainDOTcom/snappymail
and forsome strange reason it will not work! so i was wondering if this is only because the cyberpanel version of snappy has an issue .

CyberPanel’s version of snappymail is downloaded straight from the source during installation and it is not a modified version or anything.

I recommend that you guys don’t try to reverse proxy snappymail.

1 Like

I figured it out . after looking into the log I realized that the redirect link keeps going into snappymail/snappymail which is creating all the problems , the solution was editing the intial redirect to https to add /snappymail , like that .

RewriteRule ^/?(.*) https://%{SERVER_NAME}/snappymail/$1 [R,L]

so when the Proxy is taking the server name it applies snappymail right away hence
RewriteRule ^(.*)$ HTTP://cyberpanel/$1 [P]

this way it works and logs in
hope it helps the others.

@Murex no that would not work. See this

This should work. This is the solution.

Thanks a lot for your time! i’ve never seen such awesome support and community before!

your solution works like a redirect. basically people will put their mail. address and then get redirected to the cyberpanel main address with snappy
meaning if they put mailDOTdomainDOTcom they will see on the address bar
CyberpanelDOTserverdomainDOTcom/snappymail/
which is not the intended outcome.
i was thinking of setting up another proxy to mask the cyberpanel main domain page . however the solution i provided earlier is satisfying , i dont want the server domain to show up.
thats why i’m still using the proxy that was set up to cover the 8090 port

@Murex post your rewrite rules I revert if it works as intended

hello again, thanks again for all your help

so i set up the rewrite rules as so

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/snappymail/$1 [R,L]

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

keep in mind that the above code handles everything, because I changed the rewrite code from cyber panel
these ones

Rewrite Rules Added by CyberPanel Rewrite Rule Generator

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

End CyberPanel Generated Rules.

keep in mind that I followed this tutorial before remove port 8090

1 Like

My friend this part will redirect to admin panel:

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