• 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.

Resolved onyx custom template webmail

moswak

Regular Pleskian
Hi,

centos7
Plesk onyx

in Plesk 12.5 i created in /templates/custom/roundcube.php another alias
i edited
ServerAlias roundcube.webmail.*
to
ServerAlias roundcube.webmail.* mailcc.serverdomain.com

and roundcube was reachable under mailcc.serverdomain.com

but now in onyx the roundcube.php is different and there is no line i can edit ServerAlias
i found in /usr/local/psa/admin/conf/templates/default/webmail/webmail.php
copy this to /usr/local/psa/admin/conf/templates/custom/webmail/webmail.php

Code:
ServerName "webmail.<?php echo $VAR->domain->asciiName ?>"
    <?php foreach ($VAR->domain->mailAliases as $alias): ?>
        ServerAlias  "webmail.<?php echo $alias->asciiName ?>"
    <?php endforeach; ?>

i changed to

Code:
ServerName "webmail.<?php echo $VAR->domain->asciiName ?>"
    <?php foreach ($VAR->domain->mailAliases as $alias): ?>
        ServerAlias  "webmail.<?php echo $alias->asciiName ?>" mailcc.serverdomain.com
    <?php endforeach; ?>

but this doesnt work.
Where is my error ?
 
Code:
ServerAlias "webmail.<?php echo $alias->asciiName ?> mailcc.serverdomain.com"

Does not work :-(

what about /usr/local/psa/admin/conf/templates/default/webmail/nginxWebmailPartial.php ?
but there is no ServerAlias only server_name
 
Hi moswak,

Source: /usr/local/psa/admin/conf/templates/default/webmail/nginxWebmailPartial.php / line 8-14
Code:
<?php foreach ($VAR->domain->webmail->ipAddresses as $ipAddress): ?>
server {
    listen <?php echo $ipAddress->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : '') ?>;
    server_name "webmail.<?php echo $VAR->domain->asciiName ?>";
    <?php foreach ($VAR->domain->mailAliases as $alias): ?>
        server_name  "webmail.<?php echo $alias->asciiName ?>";
    <?php endforeach; ?>
 
Hi moswak,

must i edit both lines with server_name " ?
well, one is for the situation, that you have some aliases configured - so it makes sense to edit both. ;)

Btw.: Pls. remember, that the file "webmail.php" is the template for apache and the file "nginxWebmailPartial.php" is the template for nginx. You should always make sure to edit both depending files, when you make custom changes. ;)
 
Last edited by a moderator:
Code:
listen <?php echo $ipAddress->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : '') ?>;
    server_name "webmail.<?php echo $VAR->domain->asciiName ?> mailcc.serverdomain.com";
    <?php foreach ($VAR->domain->mailAliases as $alias): ?>
        server_name  "webmail.<?php echo $alias->asciiName ?> mailcc.serverdomain.com";

Does not work :-(

edit: and the normal webmail.domain.com loads without css.
I make the changes undo
 
Hi moswak,


Code:
ServerAlias "webmail.<?php echo $alias->asciiName ?> mailcc.serverdomain.com"

I was a little rash with my above answer. Actually, you should use:

For Apache ( webmail.php ) :
Code:
    ServerName "webmail.<?php echo $VAR->domain->asciiName ?>"
    ServerAlias "webmail.<?php echo $VAR->domain->asciiName ?>" "mailcc.serverdomain.com"
    <?php foreach ($VAR->domain->mailAliases as $alias): ?>
        ServerAlias  "webmail.<?php echo $alias->asciiName ?>"
    <?php endforeach; ?>

For nginx ( nginxWebmailPartial.php ) :
Code:
<?php foreach ($VAR->domain->webmail->ipAddresses as $ipAddress): ?>
server {
    listen <?php echo $ipAddress->escapedAddress . ':' . $OPT['frontendPort'] . ($OPT['ssl'] ? ' ssl' : '') ?>;
    server_name "webmail.<?php echo $VAR->domain->asciiName ?>" "mailcc.serverdomain.com";
    <?php foreach ($VAR->domain->mailAliases as $alias): ?>
        server_name  "webmail.<?php echo $alias->asciiName ?>" "mailcc.serverdomain.com";
    <?php endforeach; ?>
 
Last edited by a moderator:
Many thanks, now it works :)

Actually, you should use

You mean that there will soon be changes?
If I have read it correctly then it may be possible in the future to be able to secure webmail.domain.com by let`s encrypt.
Then the code will surely change again and my custom templates no longer work?
 
Hi moswak,

pls. have a look at => #25 for a ( maybe temporary ) solution how to secure the "webmail.*" - domains on your server with the Plesk - Let's Encrypt - extension.

You mean that there will soon be changes?
Then the code will surely change again and my custom templates no longer work?
I expect changes for the Plesk - Let's Encrypt - extension, yes and I expect them in the near future, because this extension is very popular and "doesn't work as expected right now in Plesk Onyx" ( as you can see in quite a few threads/post in the forum ). I'm pretty sure, that the Plesk developers will implement something similar, as the work-around in my above mentioned link. ;)
 
Back
Top