• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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