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

% content_for 'module' => begin

<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/emailsettingd" method="POST">

        <h2><%= l 'mai_TITLE_UNKNOWN' %></h2>

        <br>

        <div>
            <%= l 'mai_DESC_UNKNOWN' %>
        </div>

        <br>

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_UNKNOWN' %>
            </div>
            <div class="col-auto">
                % param 'EmailUnknownUser' => $mai_datas->{emailunknownuser} unless param 'EmailUnknownUser';
                <%= select_field 'EmailUnknownUser' => $c->get_emailunknownuser_opt(), class => "form-select" %>
            </div>
        </div>

        <br>

        <!--<hr class="" />-->
        <h2><%= l 'mai_TITLE_DELEGATE' %></h2>

        <br>

        <div>
            <%= l 'mai_DESC_DELEGATE' %>
        </div>

        <br>

        % param 'DelegateMailServer' => $mai_datas->{delegatemailserver} unless param 'DelegateMailServer';

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="inputDelegateMailServer" class="col-form-label"><%= l 'mai_LABEL_DELEGATE' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="DelegateMailServer" id="inputDelegateMailServer" class="form-control" aria-describedby="DelegateMailServer" value="<%= $mai_datas->{delegatemailserver} %>">
            </div>
        </div>

        <br>

        <!--<hr class="" />-->
        <h2><%= l 'mai_TITLE_SMARTHOST' %></h2>

        <br>

        <div>
            <%= l 'mai_DESC_SMARTHOST' %>
        </div>

        <br>

        % param 'SMTPSmartHost' => $mai_datas->{smtpsmarthost} unless param 'SMTPSmartHost';

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="inputSMTPSmartHost" class="col-form-label"><%= l 'mai_LABEL_SMARTHOST' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="SMTPSmartHost" id="inputSMTPSmartHost" class="form-control" aria-describedby="SMTPSmartHost" value="<%= $mai_datas->{smtpsmarthost} %>">
            </div>
        </div>

        <br>

        % param 'SMTPAUTHPROXY_status' => $mai_datas->{smtpauthproxystatus} unless param 'SMTPAUTHPROXY_status';

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <%= l 'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS' %>
            </div>
            <div class="col-auto">
                <%= select_field 'SMTPAUTHPROXY_status' => [[(l 'DISABLED') => 'disabled'], [(l 'ENABLED') => 'enabled']], class => "form-select" %>
            </div>
        </div>

        <br>

        % param 'SMTPAUTHPROXY_Userid' => $mai_datas->{smtpauthproxyuserid} unless param 'SMTPAUTHPROXY_Userid';

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="inputSMTPAuthproxy" class="col-form-label"><%= l 'mai_LABEL_SMARTHOST_SMTPAUTH_USERID' %></label>
            </div>
            <div class="col-auto">
                <input type="text" name="SMTPAUTHPROXY_Userid" id="inputSMTPAuthproxy" class="form-control" aria-describedby="SMTPAuthproxy" value="<%= $mai_datas->{smtpauthproxyuserid} %>">
            </div>
        </div>

        <br>

       % param 'SMTPAUTHPROXY_Passwd' => $mai_datas->{smtpauthproxypassword} unless param 'SMTPAUTHPROXY_Passwd';

        <div class="row g-3 align-items-center">
            <div class="col-md-2">
                <label for="password" class="col-form-label"><%= l 'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD' %></label>
            </div>
           <div class="col-auto">
                <input type="password" name="SMTPAUTHPROXY_Passwd" id="password" class="form-control" aria-describedby="SMTPAuthProxyPassword" value="<%= $mai_datas->{smtpauthproxypassword} %>">
            </div>
            <div class="col-auto">
                <span id="togglePassword" class="bi bi-eye"></span>
            </div>
        </div>






        <br>


        % my $btn = l('SAVE');
        <%= 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>

    </form>
</div>
%end