CyberPanel Community

ClosedError 500 on webmail.example1.net

EJ
Esko Junnila #1

Hi,

I successfully removed port :8090 from my url using this tutorial: https://community.cyberpanel.net/t/how-to-remove-port-8090-from-cyberpanel/30648

Then I wanted to create webmail.example1.net and webmail.example2.net so it is easier to access email.
I followed this tutorial: CyberPanel Custom Rainloop Webmail Address | DimensionQuest - Burke’s Blog!

Now I got everything working from webmail.example1.net and webmail.example2.net

But there was one last thing I wanted to make webmail users life easier. I wanted to give them ability to change their password. And for that I found this tutorial: Cyberpanel – Change password at snappymail – Tierri Lopes – Linux and WordPress DevOps

I got that working also, BUT now I cannot access from webmail.example1.net or webmail.example2.net. It gives me error 500. Then I tried to access my webmail through https://server.example.net:8090/rainloop/ but it didn’t work(error 500). This actually works before that change password extension and if i disable that extension it works. https://server.example.net:8090/snappymail/ works.

So I figured out I have to just edit that rewrite rule rainloop → snappymail, but that doesn’t work either.
My rewrite rule is:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.example.net$
RewriteRule ^(.*)$ HTTP://cyberpanel/snappymail/$1 [P]

this gives me following error:
An error occurred.
Please refresh the page and try again. Error: Failed loading /snappymail/snappymail/v/2.17.0/static/js/min/libs.min.js

I’m not good with rewrite rules, so if somebody could help me why that url gives /snappymail/snappymail

here is console errors of that page:

13 replies
tb
tbaldur #2

Interesting, perhaps the change password is adding a rewrite?

Will try to reproduce and find a solution tomorrow.

EJ
Esko Junnila #3

And I forgot to say that I have booted open litespeed. After many tries I actually booted whole server. And I have latest version of cyberpanel and keep my server updated.

Ubuntu 20.04.4

tb
tbaldur #4

Successfully reproduced your error but no solution yet sorry, rewrite rules is not my strength

EJ
Esko Junnila #5

Thanks for trying.

But I don’t get it why this works: https://server.example.net/snappymail/
but not that rewrite which basically should rewrite that same url, why there is /snappymail/snappymail. This is somenthing I don’t get. And like I said I haven’t used much rewrite rules, so could be that my rule is not right.

Is this Cyperpanel issue? Or Snappymail?

And is there some other way to get webmail work with webmail.example2.net? DNS?

EJ
Esko Junnila #6

Hi @usmannasir and sorry to bother you, but I thought you could help on this problem. Any idea how I can get this to work?

Go
Goran #9

Did you find the solution?

Sy
Syahran #11

Maybe this way can help you

RewriteEngine on
RewriteCond %{HTTP_HOST} ^webmail.example.net$
RewriteRule ^(.*)$ HTTP://cyberpanel/$1 [P]
RedirectMatch ^/$ https://webmail.example.net/snappymail
jo
josephgodwinke #15

This is the solution:

EJ
Esko Junnila #16

That did work. Thank you.

Sign in to reply