% layout 'AdminLTE', title => "Sme server 2 - emailsettings";

% content_for 'module' => begin

% use constant FALSE => 0;
% use constant TRUE  => 1;

<!-- see ibays as an example with partials -->

<div class="card-body">

    % if (config->{debug} == 1) {
        <pre>
            <%= dumper $c->current_route %>
            <= dumper $mai_datas %>
        </pre>
    % }

    % if ( stash 'error' ) {
        <br>
        <div class="text-danger">
            <%= $c->render_to_string(inline => stash 'error') %>
        </div>
    %}

    <h1><%= $title%></h1>
    <br>


    <form action="/smanager/emailsettings" method="POST">

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_POP_ACCESS_CONTROL' %>
            </div>
            <div class="col-auto">
            <%= $c->get_current_pop3_access( TRUE ) %>
            </div>
        </div>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_IMAP_ACCESS_CONTROL' %>
            </div>
            <div class="col-auto">
                <%= $c->get_current_imap_access( TRUE ) %>
            </div>
        </div>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_WEBMAIL' %>
            </div>
            <div class="col-auto">
                <%= $c->get_current_webmail_status( TRUE ) %>
            </div>
        </div>

        <br>

        % my $btn = l('mai_DESC_STATE_ACCESS_BUTTON');
        <%= hidden_field 'trt' => 'ACC' %>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary"><%= $btn %></button>
            </div>
        </div>

    </form>

    <br><br>

    <!--<hr class="" />-->

    <form action="/smanager/emailsettings" method="POST">

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_VIRUS_SCAN' %>
            </div>
            <div class="col-auto">
                <%= $c->get_virus_status(TRUE) %>
            </div>
        </div>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
            <%= l 'mai_LABEL_SPAM_SCAN' %>
            </div>
           <div class="col-auto">
           <%= $c->get_spam_status(TRUE) %>
           </div>
        </div>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_BLOCK_EXECUTABLE_CONTENT' %>
            </div>
            <div class="col-auto">
                <%= $c->get_patterns_status(TRUE) %>
            </div>
        </div>

        <br>

        % my $btn = l('mai_DESC_STATE_FILTERING_BUTTON');
        <%= hidden_field 'trt' => 'FIL' %>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary"><%= $btn %></button>
            </div>
        </div>

    </form>

    <br><br>

    <!--<hr class="" />-->

    <form action="/smanager/emailsettings" method="POST">
        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_MODE' %>
            </div>
            <div class="col-auto">
                <%= $mai_datas->{fetchmailmethod} %>
            </div>
        </div>

        % my $smtp_mesg;

        % $smtp_mesg=l('SMTP port %u allow client to authenticate:');

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25)); %>
            </div>
            <div class="col-auto">
                <%= $c->get_current_smtp_auth( TRUE ) %>
            </div>
        </div>

        % $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465)); %>
            </div>
            <div class="col-auto">
                <%= $c->get_current_smtp_ssl_auth( TRUE, 's', FALSE ) %>
            </div>
        </div>

        % $smtp_mesg=l 'Submission port %u status:';

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587)); %>
            </div>
            <div class="col-auto">
                <%= $c->get_current_smtp_ssl_auth( TRUE,'u', FALSE ) %>
            </div>
        </div>

        <br>

        % my $btn = l('mai_DESC_STATE_RECEPTION_BUTTON');
        <%= hidden_field 'trt' => 'REC' %>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary"><%= $btn %></button>
            </div>
        </div>
    </form>

    <br><br>

    <!--<hr class="" />-->

    <form action="/smanager/emailsettings" method="POST">
        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_UNKNOWN' %>
            </div>
            <div class="col-auto">
                <%= $c->get_emailunknownuser_status( TRUE ) %>
            </div>
        </div>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_DELEGATE' %>
            </div>
            <div class="col-auto">
                <%= $c->get_value('DelegateMailServer') %>
            </div>
        </div>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_SMARTHOST' %>
            </div>
            <div class="col-auto">
                <%= $c->get_value('SMTPSmartHost') %>
            </div>
        </div>

        <br>


        % my $btn = l('mai_DESC_STATE_DELIVERY_BUTTON');
        <%= hidden_field 'trt' => 'DEL' %>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <button type="submit" class="btn btn-primary"><%= $btn %></button>
            </div>
        </div>

        <br>

    </form>
</div>

%end