Articles in this section

How to limit access to a webmail in Plesk to a specific IP?

kb: how-to Plesk for Linux

Question

How to restrict access to webmail.example.com for all IP except one? 

Answer

  1. Connect to the server via SSH
  2. Create a custom template directory if it doesn't exist.

    # mkdir -p /usr/local/psa/admin/conf/templates/custom/webmail

  3. Copy the Roundcube template

    # cp -a /usr/local/psa/admin/conf/templates/default/webmail/nginxWebmailPartial.php /usr/local/psa/admin/conf/templates/custom/webmail/nginxWebmailPartial.php

  4. Open the template /usr/local/psa/admin/conf/templates/custom/webmail/nginxWebmailPartial.php and add inside the block "server {}":

    CONFIG_TEXT: allow 203.0.113.10;
    allow 198.51.100.20;
    allow 192.168.10.0/24;
    allow 2001:db8:1234::/64;
    deny all;

  5. Rebuild configurations:

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

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.