Error 500 on webmail.example1.net

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:

Interesting, perhaps the change password is adding a rewrite?

Will try to reproduce and find a solution tomorrow.

1 Like

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

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

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?

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?

Looks to me that you might have the same issue as me, I got 503, blank page.
Proxy showing blank page - Support and Discussion - CyberPanel Community

Did you find the solution?

No I did not.

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

Thanks for your help.

Now it redirects webmail.example.net to cyberpanel login. If I try webmail.example.net/snappymail then it works, but I would still prefer webmail.example.net to go snappymail login. It is much easier for people to remember.

But anyway this is progress :slight_smile:

Any idea how to get this work? Or do you know good site where I could learn rewrite rules?

bro i figured it out using this method here , it now redirects correctly

custom URL for webmail

This is the solution:

That did work. Thank you.

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.