{* Mail server actions page.

   Reuses the full web-server actions layout (status snapshot, services,
   users, packages, IPs, maintenance, log) — Hestia exposes the same admin
   surface for mail-only nodes — but with one explicit difference: the PHP
   tab is hidden, since mail servers do not host customer PHP applications.

   Mail-specific features (exim queue inspection, DKIM key viewer, mail
   queue stats) ride on top of the shared Services / System Config tabs:
   Services tab shows exim4, dovecot, clamav-daemon, spamassassin states;
   System Config tab shows MAIL_SYSTEM / IMAP_SYSTEM / ANTISPAM_SYSTEM etc.
   The Group config tab compares against the group's mail-target keys via
   the schema's per-category target tagging (see HestiaConfigSchema). *}

{include file="$dir/templates/server_actions_web.tpl"}

<style>
    /* Native :has() — Chrome/Edge 105+, Safari 15.4+. */
    .nav-tabs li:has(> a[href="#puq-tab-php"]),
    #puq-tab-php { display: none !important; }
</style>

{literal}
<script>
(function(){
    // Belt-and-braces for browsers without :has() support and to switch the
    // active tab if URL or default pointed at #puq-tab-php somehow.
    $(function(){
        var $phpLink = $('.nav-tabs a[href="#puq-tab-php"]');
        $phpLink.closest('li').hide();
        $('#puq-tab-php').hide();
        if ($phpLink.parent('li').hasClass('active')) {
            $('a[href="#puq-tab-config"]').tab('show');
        }
        // Update Back link to point at mail_servers, not web_servers.
        // server_actions_web.tpl already does this dynamically (it inspects
        // s.type), so no override needed here.
    });
})();
</script>
{/literal}
