• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved How to permanent force https for webmail?

Tremark

New Pleskian
Hi,

We are using Plesk in version 12.5.30. We would like to force https for webmail on one of ours domains.
I made some research how to set https for webmail.domain.com but I didn't find any solution to make it permanent.

I think the easiest way is force use ssl in config file /etc/apache2/plesk.conf.d/horde.conf and /etc/apache2/plesk.conf.d/roundcube.conf in VirtualHost directive but in this files i see information:

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

I'm afraid that when we will upgrade plesk or we will make some other changes this file will be regenerated and we will need to configure https again.

Have you got any idea how to force https permanent?
At this time we would like to set https for one domain. Plesk is installed on Debian distribution.

I'll be grateful for any help.

Best regards,
Tremak
 
Hi Tremark,
and welcome to the forum.
It's very easy to do, you can just edit the templates for webmail.

Copy files...
/usr/local/psa/admin/conf/templates/default/horde.php
/usr/local/psa/admin/conf/templates/default/roundcube.php
/usr/local/psa/admin/conf/templates/default/nginxWebmailPartial.php

to the following folder (create if not already there)...

/usr/local/psa/admin/conf/templates/custom/horde.php
/usr/local/psa/admin/conf/templates/custom/roundcube.php
/usr/local/psa/admin/conf/templates/custom/nginxWebmailPartial.php


And then you can edit the files.

I added the redirect at around line 33 of horde.php...
Code:
Redirect 301 / https://webmail.domain.tld/


And you'll probably want to add HSTS header in the nginxWebmailPartial.php ...
Code:
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";


Just make sure it's in the "ssl" section.
Then you can regenerate the config files with...

Code:
# /usr/local/psa/admin/bin/httpdmng --reconfigure-all


I hope that helps.
Kind regards

Lloyd
 
Thank you for reply. I see it should work but exactly what we need is redirect only one domain to https at now.

I know that we can specify domain which config will be reconfigured but how to create custom config for one domain?
How to prevent change configuration for all domains when admin will use --reconfigure-all option? :)

Br,
Tremark
 
Thank you Lloyd. It works.
As I thought all subdomains webmails redirecting to main webmail address, eg. webmail.domain1.com, webmail.domain2.com are redirecting to webmail.domain.com. It's enought for me at now.
 
Back
Top