How to enable/disable HTTPS redirection for webmail in Plesk for Linux

Follow

Comments

16 comments

  • Avatar
    João Alves

    Hi!

     

    I've followed the solution 2.2 (Onyx) without luck.

    I've also restarted the services after the reconfigure.

    apache2.service

    nginx.service

    plesk.phpxx.fpm.service

     

    Can you help please?

    0
    Comment actions Permalink
  • Avatar
    João Alves

    Please ignore, I've inserted the code below, not above </virtualhost>.

     

    my bad, it's working

    0
    Comment actions Permalink
  • Avatar
    Lev Iurev

    @João Alves Glad to know:)

    0
    Comment actions Permalink
  • Avatar
    João Alves (Edited )

    Thank you for this how to !

     

    Regards

    0
    Comment actions Permalink
  • Avatar
    Ralph Jäger

    Adding this line works for me obtaining the Let's Encrypt certificate

    ProxyPass /.well-known/acme-challenge/ !

     

    0
    Comment actions Permalink
  • Avatar
    Jeffrey Zeunert

    Thank you for this article. I was able to make this redirect and experienced no downtime for my client's sites. I'm wondering, however, if creating the Plesk configuration template undid configuration changes I made probably in httpd.conf file? DirectoryIndex changed and loads html files first whereas it had been loading php files first.

     

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    @Jeffrey Zeunert

    Hello!

    This is expected behavior.

    Applying configuration template deletes all changes done manually in Apache/Nginx configuration files.

    0
    Comment actions Permalink
  • Avatar
    Nucleus Inc. NOC

    I think the best solution to this would have a checkbox on the "mail settings" page for domains to enable 301 redirect when applying a SSL cert, just like there is on the "hosting settings" page.

     

    Please vote for this!

    https://plesk.uservoice.com/forums/184549-feature-suggestions/suggestions/31900489-redirect-from-http-to-https-for-secured-webmails

    it will fix all these problems without admins having to mess around in config files that could get overwritten by updates.

    1
    Comment actions Permalink
  • Avatar
    Christopher Smith

    In Solution 3 for Roundcube below you should really add the $config['force_https'] = true; to  /usr/share/psa-roundcube/config/config.inc.php instead so that if you do an update it won't be overwritten.

    Solution 3: Using native configuration file of Roundcube/Horde

     

    For Plesk: Roundcube webmail

    1. Connect to a Plesk server via SSH.

    2. Open the file /usr/share/psa-roundcube/config/defaults.inc.php in any text editor and change the value of "$config['force_https']" to "true":

      $config['force_https'] = true;

    3. Save the changes and close the file.

    0
    Comment actions Permalink
  • Avatar
    Pavel Mikhaylov

    Hi Christopher,

    Thanks for your input. I added it to the article.

    0
    Comment actions Permalink
  • Avatar
    Jeffrey Zeunert

    I had done this webmail redirect back in February and see that now it no longer works. I tried to redo this and am getting an error "no such file or directory" when i try to copy it to the newly created folder. Have the locations changed since this article was written?

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Jeffrey

    Please re-check the path. On the screenshot I see that you have created the /usr/local/psa/admin/conf/templates/webmail folder, not the /usr/local/psa/admin/conf/templates/custom/webmail one.

    0
    Comment actions Permalink
  • Avatar
    Jeffrey Zeunert

    Thank you Alisa. That worked once I created the second folder.

    0
    Comment actions Permalink
  • Avatar
    Bernhard

    For me all of the 3 suggested solutions did not work (ubuntu 18.04) together with Lets Encrypt!

    The problem:

    If you try to secure the domain with lets encrypt and you also want to include "webmail.yourdomain.com" in the certificate, you'll get an error that one or more additional domains have not been secured... I've tried all 3 solutions and it's the same for all. As soon as I disabled the HTTP to HTTPS redirect for webmail, the cert issued without any errors.

    My solution: I changed the RewriteCond to this:

    RewriteCond %{REQUEST_URI} !\.well-known/acme-challenge
    0
    Comment actions Permalink
  • Avatar
    Alexandros Rapsomanikis (Edited )

    Hello everyone,

    just a small notice, Version 1.1.3-561 of SSL It!, doesn't seem to have the Configure link that is mentioned in Solution 1 (Apply redirect to webmail). I believe this version is the latest for Plesk Onyx, since there isn't an update at the time of writing this comment. Is there a reason it's not there or are we missing something? I've noticed that other people have complained about the same thing at the User's Voice Thread comments.

    Either way, I prefered Solution 3, to secure the webmail interface.

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Alexandros Rapsomanikis
    At the moment, the latest version of SSL It! is 1.1.4-570.
    When the "Redirect from http to http" option is disabled, there is no "Configure" link there. However, as soon as you enable it, the link appears (and the webmail checkbox as well).

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request