• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved webmail redirect to https

finbarr69

Basic Pleskian
Since upgrading to Onxy, my redirect to for webmail (roundcube) from http to https has stopped working. The upgrade did remove two custom templates and backed them up. These were:

/usr/local/psa/admin/conf/templates/default/domainWebmail.php
and
/usr/local/psa/admin/conf/templates/default/roundcube.php

I tried reinstating these and reconfiguring, but they have no effect. I removed them again and reconfigured again.

I have also tried How to redirect webmail HTTP to HTTPS (initially trying Solution 2.2, then when that had no effect, trying solution 1).

None of the solutions has worked. I am beginning to wonder if the path names or flenames in the plesk article are accurate? Or is there an error in the article?

This is Onyx 17.5.3 on CentOS 6.9

Thanks

Brian
 
Hi finbarr69,

I tried reinstating these and reconfiguring, but they have no effect. I removed them again and reconfigured again.
Sorry, but you missed some really essential basics here:

Never ever edit "default" webserver templates of Plesk. It is NOT supported, nor recommended. The reason is basically, that Plesk updates/upgrades/patches may overwrite your changes and Plesk could change the whole structure and relations/dependencies, so that you could break the whole functionality, when you edit default templates!

You missed completely, that Plesk changed a whole lot of templates and dependencies in the past, so that for example "/usr/local/psa/admin/conf/templates/default/domainWebmail.php" doesn't even exist and you won't find any dependencies, when you search for "domainWebmail.php" with the example command:
Code:
find /usr/local/psa/admin/conf/templates/default -type f -name "*.php" -exec grep --color -Hni "domainWebmail" {} \;
Nearly the same for "roundcube.php", which is now located at "/usr/local/psa/admin/conf/templates/default/webmail/roundcube.php" and is completely different to earlier templates from 12.5 for example. ;)


If you really desire to change webserver configuration templates, pls. follow:



If you desire to redirect http - traffic to https when you use "roundcube" on your server, pls. change:
Code:
...
// enforce connections over https
// with this option enabled, all non-secure connections will be redirected.
// set the port for the ssl connection as value of this option if it differs from the default 443
$config['force_https'] = false;
...
to
Code:
...
// enforce connections over https
// with this option enabled, all non-secure connections will be redirected.
// set the port for the ssl connection as value of this option if it differs from the default 443
$config['force_https'] = true;
...
... at "/usr/share/psa-roundcube/config/defaults.inc.php"​
 
Lol. Thanks, however I was only following Plesk documents that made no mention of the changed structure for Onyx. Editing /usr/share/psa-roundcube/config/defaults.inc.php fixes it, thanks. But I got a row for changing a file that Plesk will overwrite. So... is /usr/share/psa-roundcube/config/defaults.inc.php the correct file to edit and Plesk will not overwrite it? :)

Thanks
Brian
 
Hi finbarr69,

because there are very, very few reasons why Plesk would replace/overwrite the "defaults.inc.php" file, and there are no reasons to override your unique http-to-https configuration and third, because this configuration file is explizit used to configure your roundcube - installation, this is the exact/correct place, where you should configure this unqiue modification. ;)

I can't guarantee, that Plesk will never overwrite "defaults.inc.php", so pls. make as well a backup of your file, so that you are able to rebuilt it, if this would ever be the case. :)
 
Thank you. This is good to know. :)

So, Plesk need to correct the faulty document at How to redirect webmail HTTP to HTTPS which does not work for Onyx and replace it with your fix (editing defaults.inc.php) which does work. How can I ask Plesk to fix the faulty document, do you know?

Thanks for the help and warmest wishes.
 
Hi finbarr69,

How can I ask Plesk to fix the faulty document, do you know?
To "call" for a Plesk - Team - Member, you have the choice to add a "@" - sign in front of a forum - nickname ( for example @IgorG ). This will inform the forum user, that he/she has been mentioned and he/she will ( mostly ) visit the thread, to inform him/herself, WHY this has been the case. ;)
 
I can't guarantee, that Plesk will never overwrite "defaults.inc.php", so pls. make as well a backup of your file, so that you are able to rebuilt it, if this would ever be the case. :)

Indeed is a very practical solution, about overwrite or not in updates, it depends on how rpm package of plesk-roundcube [1] is configure If rpm spec have noreplace [2] in defaults.inc.php files sections or not ?

[2]
RPM, %config, and (noreplace)
Creating RPM Packages with Fedora - FedoraProject
http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html

[1]
rpm -qf /usr/share/psa-roundcube/config/defaults.inc.php -i
Name : plesk-roundcube
Version : 1.2.5
Release : cos7.build1705170711.12
Architecture: noarch
Install Date: Sáb 22 Jul 2017 12:43:06 BST
Group : Web
Size : 16426939
License : GPL
Signature : DSA/SHA1, Ter 11 Jul 2017 06:03:11 BST, Key ID bd11a6aa914bdf7e
Source RPM : plesk-roundcube-1.2.5-cos7.build1705170711.12.src.rpm
Build Date : Ter 11 Jul 2017 06:03:03 BST
Relocations : (not relocatable)
Packager : Plesk <[email protected]>
Vendor : Roundcube
URL : Roundcube - Free and Open Source Webmail Software
Summary : The Roundcube web mail client adopted for Plesk Onyx
Description :
The Roundcube webmail project project is a free and open source webmail
solution with a desktop-like user interface which is easy to install/configure
and that runs on a standard LAMPP server.
 
In horde. we may use a similar technique edit
/etc/psa-webmail/horde/horde/conf.php and set ['use_ssl'] =1 based on [1] this is valid.
Or you may do the thing by horde web client, as horde administrator, you may set the emails that have admin preferences, in admin preferences , i.e. gear wheel -> administration -> configuration -> horde -> general -> URL Settings , choose assume that we are in SSL and always generate https URLs.

[1]
How-to force Horde webmail to use SSL only
 
Back
Top