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

% content_for 'module' => begin

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

<div class="card-body">

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

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

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

    %= form_for 'emailsettings' => (method => 'POST') => begin
    <p>
    <span class="">
    %=l 'mai_LABEL_POP_ACCESS_CONTROL'
    </span>
    <span class="">
    %= $c->get_current_pop3_access( TRUE )
    </span>
    </p>

    <p>
    <span class="">
    %=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
    </span>
    <span class="">
    %= $c->get_current_imap_access( TRUE )
    </span>
    </p>

    <p>
    <span class="">
    %=l 'mai_LABEL_WEBMAIL'
    </span>
    <span class="">
    %= $c->get_current_webmail_status( TRUE )
    </span>
    </p>

    %  my $btn = l('mai_DESC_STATE_ACCESS_BUTTON');
    <div class="">
    %= submit_button "$btn", class => ""
    </div>

    %= hidden_field 'trt' => 'ACC'
    % end   
    <br> 

    <!--<hr class="" />-->
    
    %= form_for 'emailsettings' => (method => 'POST') => begin
    <p>
    <span class="">
    %=l 'mai_LABEL_VIRUS_SCAN'
    </span>
    <span class="">
    %= $c->get_virus_status(TRUE)
    </span>
    </p>

    <p>
    <span class="">
    %=l 'mai_LABEL_SPAM_SCAN'
    </span>
    <span class="">
    %= $c->get_spam_status(TRUE)
    </span>
    </p>

    <p>
    <span class="">
    %=l 'mai_LABEL_BLOCK_EXECUTABLE_CONTENT'
    </span>
    <span class="">
    %= $c->get_patterns_status(TRUE)
    </span>
    </p>

    %   my $btn = l('mai_DESC_STATE_FILTERING_BUTTON');
    <div class="">
    %= submit_button "$btn", class => ""
    </div>

    %= hidden_field 'trt' => 'FIL'
    % end  
    <br>  

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

    %= form_for 'emailsettings' => (method => 'POST') => begin
    <p>
    <span class="">
    %=l 'mai_LABEL_MODE'
    </span>
    <span class="">
    %= $mai_datas->{fetchmailmethod}
    </span>
    </p>
    
    % my $smtp_mesg;

    % $smtp_mesg=l('SMTP port %u allow client to authenticate:');
    <p>
    <span class="">
        %= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25)); 
    </span>
    <span class="">
        %= $c->get_current_smtp_auth( TRUE )
    </span>
    </p>

    % $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');
    <p>
    <span class="">
        %= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465)); 
    </span>
    <span class="">
        %= $c->get_current_smtp_ssl_auth( TRUE, 's', FALSE )
    </span>
    </p>

    % $smtp_mesg=l 'Submission port %u status:';
    <p>
    <span class="">
        %= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587)); 
    </span>
    <span class="">
    %= $c->get_current_smtp_ssl_auth( TRUE,'u', FALSE )
    </span>
    </p>
    <br />

    % my $btn = l('mai_DESC_STATE_RECEPTION_BUTTON');
    <div class="">
    %= submit_button "$btn", class => ""
    </div>

    %= hidden_field 'trt' => 'REC'
    % end    
    <br>

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

    %= form_for 'emailsettings' => (method => 'POST') => begin
    <p>
    <span class="">
    %=l 'mai_LABEL_UNKNOWN'
    </span>
    <span class="">
    %= $c->get_emailunknownuser_status( TRUE )
    </span>
    </p>

    <p>
    <span class="">
    %=l 'mai_LABEL_DELEGATE'
    </span>
    <span class="">
    %= $c->get_value('DelegateMailServer')
    </span>
    </p>

    <p>
    <span class="">
    %=l 'mai_LABEL_SMARTHOST'
    </span>
    <span class="">
    %= $c->get_value('SMTPSmartHost')
    </span>
    </p>

    % my $btn = l('mai_DESC_STATE_DELIVERY_BUTTON');
    <div class="">
        %= submit_button "$btn", class => ""
    </div>

    %= hidden_field 'trt' => 'DEL'
    % end    

</div>
%end