Create the webmail sub account as you normally would.
Install the certificate for the webmail sub account as you normally would.
Then create the directory:
mkdir -p /usr/local/apache/conf/userdata/ssl/2/<user>/webmail.domain.com
Where <user> refers to the owner of the webmail.domain.com account.
Then create a file in this directory:
/usr/local/apache/conf/userdata/ssl/2/<user>/webmail.domain.com/proxy.conf
In that file add:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
UseCanonicalName Off
</IfModule>
Save the file and run:
/scripts/ensure_vhost_includes --user=<user>
Now when users need to access the webmail via proxy, you can just tell them to go to:
https://webmail.domain.com
For an added bonus you can insure that SSL is always used.
Create the directory:
mkdir -p /usr/local/apache/conf/userdata/std/2/<user>/webmail.domain.com
Create a file:
/usr/local/apache/conf/userdata/std/2/<user>/webmail.domain.com/rewrite.conf
In that file add:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
Save the file and again run the command:
/scripts/ensure_vhost_includes --user=<user>
This will redirect traffic to http://webmail.domain.com to https://webmail.domain.com therefore insuring that the site is always accessed via SSL.