• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Modify VirtualServer setting for webmail

jradzuweit

Basic Pleskian
I just solved temporary a sync problem for the webmail with Horde by editing the apache config file
/etc/apache2/plesk.conf.d/webmails/<myDomain>_webmail.conf
Now I want to make this fix permanent, because the above file is generated from the templates in
/usr/local/psa/admin/conf/templates/default/webmail
Actually I want to place the following code in the final domain webmail conf file

HTML:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

Any suggestions to do this best?
 
... the docs suggest to put in ./templates/custom, but I am not familiar with php programming and how to put it in the file
 
here is my solution for this

1. Create the custom file
root@vega:/usr/local/psa/admin/conf/templates# ll
insgesamt 16
drwxr-xr-x 4 root root 4096 Mär 2 2016 ./
drwxr-xr-x 5 root root 4096 Jan 6 06:26 ../
drwxr-xr-x 6 root root 4096 Dez 22 07:14 default/
drwxr-xr-x 3 root root 4096 Mär 2 2016 pci_compliance/
root@vega:/usr/local/psa/admin/conf/templates# mkdir -p custom/webmail
root@vega:/usr/local/psa/admin/conf/templates# cp default/webmail/horde.php custom/webmail/
root@vega:/usr/local/psa/admin/conf/templates# ll custom/webmail/
insgesamt 12
drwxr-xr-x 2 root root 4096 Jan 6 22:34 ./
drwxr-xr-x 3 root root 4096 Jan 6 22:33 ../
-rw-r--r-- 1 root root 1202 Jan 6 22:34 horde.php

2. Append the additional code to the end of the horde.php file,
Here my result, at the end there is the rewrite rule

PHP:
<?php
    /** @var Template_VariableAccessor $VAR */
    $hordeDocroot = $VAR->server->webserver->horde->docroot;
    $hordeSysUser = "horde_sysuser";
    $hordeSysGroup = "horde_sysgroup";
    $hordePhpIni = $VAR->server->webserver->horde->confD . "/horde/php.ini";
?>
    DocumentRoot "<?php echo $hordeDocroot ?>"
    Alias /horde/ "<?php echo $hordeDocroot ?>/"

    <IfModule mod_suexec.c>
        SuexecUserGroup "<?php echo $hordeSysUser; ?>" "<?php echo $hordeSysGroup; ?>"
    </IfModule>

    <IfModule mod_fcgid.c>
        FcgidInitialEnv PP_CUSTOM_PHP_CGI_INDEX fastcgi
        FcgidInitialEnv PP_CUSTOM_PHP_INI "<?php echo $hordePhpIni; ?>"
        FcgidMaxRequestLen 134217728
        <Directory "<?php echo $hordeDocroot ?>">
            <Files ~ (\.php$)>
                SetHandler fcgid-script
                FCGIWrapper <?php echo $VAR->server->webserver->apache->phpCgiBin ?> .php
                Options +ExecCGI
            </Files>

        <?php if ($VAR->server->webserver->apache->useRequireOption): ?>
            Require all granted
        <?php else: ?>
            Order allow,deny
            Allow from all
        <?php endif; ?>
        </Directory>
    </IfModule>

    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
    </IfModule>

3. Check that the syntax of the file is ok
Code:
root@vega:/usr/local/psa/admin/conf/templates/custom/webmail# php -l horde.php
No syntax errors detected in horde.php

4. Create new domain config files

Code:
root@vega:/usr/local/psa/admin# bin/httpdmng --reconfigure-domain <your domain>
and check the file
/etc/apache2/plesk.conf.d/webmails/<your domain>_webmail.conf

That's it
 
Back
Top