Hey, I followed the tutorial you linked here. it works. but at the end of the day, redirects your address bar url to mydomain.com/snappymail. is there any way to keep the 301 rule and keep the address in the address bar to webmail.domain.com
Here is the log that shows this error…
[2022-12-19 19:34:25.660][af79299e] INFO[DATA]: [DATE:2022-12-19 UTC][SM:2.15.3][IP:192.168.15.254][PID:92997][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-12-19 19:34:25.660][af79299e] REQUEST[NOTE]: [GET] https://mail.mydomain.com/snappymail/
[2022-12-19 19:34:25.689][af79299e] INFO[MEMORY]: Memory peak usage: 2MB
[2022-12-19 19:34:25.689][af79299e] INFO[TIME]: Time delta: 0.07535195350647
[2022-12-19 19:34:27.169][b0f025b2] INFO[DATA]: [DATE:2022-12-19 UTC][SM:2.15.3][IP:192.168.15.254][PID:92997][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-12-19 19:34:27.169][b0f025b2] REQUEST[NOTE]: [GET] https://mail.mydomain.com/snappymail/?/AppData/0/17282663328686265/
[2022-12-19 19:34:27.171][b0f025b2] APPDATA[DATA]: rl.initData({“Auth”:false,“AccountHash”:“”,“AccountSignMe”:false,“MailToEmail”:“”,“Email”:“”,“DevEmail”:“”,“DevPassword”:“”,“Title”:“SnappyMail Webmail”,“LoadingDescription”:“SnappyMail”,“FaviconUrl”:“”,“LoginDefaultDomain”:“”,“hideSubmitButton”:false,“DetermineUserLanguage”:true,“DetermineUserDomain”:true,“SieveAllowFileintoInbox”:false,“ContactsIsAllowed”:false,“Admin”:,“Capa”:,“Plugins”:,“System”:{“version”:“2.15.3”,“admin”:false,“token”:“ae193d0888b7f9a0aebe8aa0abff51f46d6ccfd4”,“inIframe”:false,“allowHtmlEditorBitiButtons”:false,“allowCtrlEnterOnCompose”:true,“useImapThread”:true,“allowAppendMessage”:false,“folderSpecLimit”:50,“listPermanentFiltered”:false,“themes”:[“Default”,“A”,“Blurred”,“DarkShine”,“Linen”,“Love”,“Snow”,“SnowDarkV1”,“Squares”,“SquaresDark”,“Stripes”,“Wood”,“Xv”,“Clear”],“languages”:[“ar-SA”,“bg-BG”,“cs-CZ”,“da-DK”,“de-DE”,“el-GR”,“en”,“en-US”,“es-ES”,“et-EE”,“fa-IR”,“fi-FI”,“fr-FR”,“hu-HU”,“id-ID”,“is-IS”,“it-IT”,“ja-JP”,“ko-KR”,“lt-LT”,“lv-LV”,“nb-NO”,“nl-NL”,“pl-PL”,“pt-BR”,“pt-PT”,“ro-RO”,“ru-RU”,“sk-SK”,“sl-SI”,“sv-SE”,“tr-TR”,“uk-UA”,“zh-CN”,“zh-TW”],“languagesAdmin”:[“cs-CZ”,“da-DK”,“de-DE”,“en”,“es-ES”,“fa-IR”,“fi-FI”,“fr-FR”,“hu-HU”,“id-ID”,“it-IT”,“ja-JP”,“lt-LT”,“nb-NO”,“nl-NL”,“pl-PL”,“pt-BR”,“ru-RU”,“sk-SK”,“sl-SI”,“sv-SE”,“zh-CN”],“attachmentsActions”:[“zip”],“customLogoutLink”:“”},“NewMoveToFolder”:true,“AllowLanguagesOnSettings”:true,“AllowLanguagesOnLogin”:true,“AttachmentLimit”:2097152,“SignMe”:“DefaultOff”,“UseLocalProxyForExternalImages”:true,“ViewHTML”:true,“ShowImages”:false,“RemoveColors”:false,“MessagesPerPage”:20,“MessageReadDelay”:5,“SoundNotification”:true,“NotificationSound”:“new-mail”,“DesktopNotifications”:true,“Layout”:1,“EditorDefaultType”:“Html”,“UseCheckboxesInList”:true,“AutoLogout”:30,“UseThreads”:false,“AllowDraftAutosave”:true,“ReplySameFolder”:false,“ContactsAutosave”:true,“HideUnsubscribed”:false,“MainEmail”:“”,“KolabContactFolder”:“”,“UserBackgroundName”:“”,“UserBackgroundHash”:“”,“AdditionalLoginError”:“”,“Theme”:“Default”,“Language”:“en-US”,“UserLanguage”:“en-US”,“PluginsLink”:“”,“StaticLibsJs”:“/snappymail/snappymail/v/2.15.3/static/js/min/libs.min.js”});
[2022-12-19 19:34:27.171][b0f025b2] INFO[MEMORY]: Memory peak usage: 2MB
[2022-12-19 19:34:27.171][b0f025b2] INFO[TIME]: Time delta: 0.0051159858703613
Welcome @saidearly Happy you are here
Run
sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)
If using a sudo user rather than root, try this:
sudo su - -c "sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)"
Already on the latest release. I have even done fresh installation couple times. But the error is the same.
Run
$ rm -rf /usr/local/CyberCP/public/snappymail
$ rm -rf /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs
# RUN CYBERPANEL UPGRADE AS IT WILL DO EVERYTHING FOR YOU
# run the rest if you want to personalize (not recommended for beginners)
$ wget https://github.com/the-djmaze/snappymail/releases/download/v2.17.0/snappymail-2.17.0.zip
$ unzip snappymail-2.17.0.zip -d /usr/local/CyberCP/public/snappymail
$ cd /usr/local/CyberCP/public/snappymail
$ find . -type d -exec chmod 755 {} \;
$ find . -type f -exec chmod 644 {} \;
$ mkdir -p /usr/local/lscp/cyberpanel/rainloop/data
$ mkdir -p /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/
$ mkdir snappymail configs
$ cat << EOF >> /usr/local/lscp/cyberpanel/rainloop/data/_data_/_default_/configs/application.ini
[labs]
imap_folder_list_limit = 0
autocreate_system_folders = On
EOF
$ cat << EOF >> /usr/local/CyberCP/public/snappymail/snappymail/v/2.17.0/include.php
$sCustomDataPath = '/usr/local/lscp/cyberpanel/rainloop/data';
EOF
# you will need to comment out any other $sCustomDataPath = before the one we appended above
$ cat << EOF >> /usr/local/CyberCP/public/snappymail/_include.php
define('APP_DATA_FOLDER_PATH', '/usr/local/lscp/cyberpanel/rainloop/data/');
EOF
$ cat << EOF >> /usr/local/CyberCP/public/snappymail/include.php
define('APP_DATA_FOLDER_PATH', '/usr/local/lscp/cyberpanel/rainloop/data/');
EOF
$ mkdir snappymail configs
$ sed -i 's|autocreate_system_folders = Off|autocreate_system_folders = On|g' 2.17.0
Followed your direction with Cyberpanel upgrade. Results = same error after upgrade.
Then I tried manual process following you steps
and getting the errors at the end
root@trahezy:/usr/local/CyberCP/public/snappymail# mkdir snappymail configs
mkdir: cannot create directory ‘snappymail’: File exists
mkdir: cannot create directory ‘configs’: File exists
root@trahezy:/usr/local/CyberCP/public/snappymail# sed -i ‘s|autocreate_system_folders = Off|autocreate_system_folders = On|g’ 2.17.0
sed: can’t read 2.17.0: No such file or directory
I switched into the directory v where 2.17.0 directory is located and got this
root@trahezy:/usr/local/CyberCP/public/snappymail/snappymail/v# sed -i ‘s|autocreate_system_folders = Off|autocreate_system_folders = On|g’ 2.17.0
sed: couldn’t edit 2.17.0: not a regular file
Did you remove the previous snappymail installation v2.18.6 as i advised above?
Yes. I did. I just repeated again the process and after cyberpanel upgrade. i did snappymail version change to 2.17.0.
Got same error
No. Not really getting that error.
Accessing the snappymail through cybepanel domain/snappymail works but using its dedicated subdomain is the issue
Example:
cyberpaneldomaincom/snappymail = working
maildomaincom = the error
RewriteRules
Rewrite Rules Added by CyberPanel Rewrite Rule Generator
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.)$
RewriteRule ^(.)$ http://%1/$1 [L,R=301]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.) https://%{SERVER_NAME}/$1 [R,L]
RewriteRule ^(.)$ https://cyberpanel/snappymail/$1 [P]
End CyberPanel Generated Rules.
SHould not work since cyberpanel creates or any other panel create a mailserver from that domain. You need to add something like webmail.myprimarydomain.com
If you look at the post you will see he/she ran into this issue:
Doesn’t work with webmaildomaincom that was just example.
Try to do clean install of cyberpanel and do the webmaildomaincom to reproduce the issue.
by the way
Even though the maildomaincom is used by mailserver ports for webserver are not on mailserver so web access to the maildomaincom should work fine without issue. Just a highlight.
Refreshed and cleared cache and tried a new browser all go back to same error
Are you in a position to reinstall your server os and start over? If so share your server os type and version
Good evening, I don’t know if you are still interested, but to do the proxy correctly I solved it this way. I hope it can be the help to someone!
### [PROXY] Snappymail
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/snappymail
REWRITERULE ^(.*)$ https://cyberpanel/snappymail/$1 [P,L,E=PROXY-HOST:www.example.com]
RewriteCond %{REQUEST_URI} ^/snappymail
REWRITERULE ^(.*)$ https://cyberpanel/$1 [P,L,E=PROXY-HOST:www.example.com]
www.example.com should be replaced with the correct host.
Already installed like 5 times ending up with the same results.
Hi,
Thanks for your contribution,
Your configuration works super smooth.
Thanks mate.
You all be blessed.
Hi
Where i put this code?
This is for each domain?