How to secure webmail with SSL certificate in Plesk 12.x?


2017-04-06 23:58:52 UTC


2017-08-08 13:23:03 UTC


Was this article helpful?

Have more questions?

Submit a request

How to secure webmail with SSL certificate in Plesk 12.x?

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows


How to secure webmail with SSL certificate in Plesk 12.x?


The ability to protect webmail using SSL certificate was introduced in Plesk Onyx .

There is no any workaround for Plesk 12.x on Windows.

The following workaround is available for Plesk 12.x on Linux.

Create the subdomain, configure its DocumentRoot path (the directory on the server where the web pages of a site are stored), then manually assign SSL certificate for the webmail. To manually assign SSL for webmail, edit its configuration file:

Note: The following solution applies to Roundcube webmail. In the case of Horde webmail, modify the horde.conf file.

  1. Create a backup of the configuration file using the following command.

    For CentOS based OS:

    # cp -p /etc/httpd/conf/plesk.conf.d/roundcube.conf{,.conf_back}

    For Debian based OS:

    # cp -p /etc/apache2/plesk.conf.d/roundcube.conf{,.conf_back}
  2. Modify the ServerName and SSLCertificateFile directives in the configuration file. For example:

    SSLCertificateFile /full/path/to/the/certificate/file
  3. Restart the web server, depending on your operating system:

    # service httpd restart


    # /etc/init.d/apache2 restart

    If it is required to redirect all webmails to one main webmail, it is possible to do using Apache rewrite rule:

  4. Modify these files (for Horde and Roundcube):

  5. Add these lines with rewrite rule for Apache configuration (for example, before <IfModule mod_fcgid.c> ):

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^webmail\\.(.+)$ [NC]
    RewriteCond %{HTTP_HOST} !^
    RewriteRule ^(.*)$ [R=301,L]

    Note: should be changed to the main webmail DNS name that will be used for redirecting.

  6. Restart Apache

  7. Check is it working properly.

  8. If yes, modify Plesk custom templates to make sure that settings are not overwritten after upgrade according to the documentation .

    Required files are horde.php and roundcube.php .

Have more questions? Submit a request
Please sign in to leave a comment.