<div class="tab-pane fade" id="tab-user-settings" role="tabpanel" aria-labelledby="tab-user-settings">
  <div class="card mb-4">
    <div class="card-header d-flex fs-5">
      <button class="btn d-md-none flex-grow-1 text-start" data-bs-target="#collapse-tab-user-settings" data-bs-toggle="collapse" aria-controls="collapse-tab-user-settings">
        {{ lang.user.mailbox_settings }}
      </button>
      <span class="d-none d-md-block">{{ lang.user.mailbox_settings }}</span>
    </div>
    <div id="collapse-tab-user-settings" class="card-body collapse" data-bs-parent="#user-content">
      {# Show tagging options #}
      <div class="row">
        <div class="col-sm-3 col-12 text-sm-end text-start text-xs-bold mb-4">{{ lang.user.tag_handling }}:</div>
        <div class="col-sm-9 col-12">
          <div class="btn-group" data-acl="{{ acl.delimiter_action }}">
            <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline{% if get_tagging_options == 'subfolder' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="delimiter_action"
            data-api-url='edit/delimiter_action'
            data-api-attr='{"tagged_mail_handler":"subfolder"}'>{{ lang.user.tag_in_subfolder }}</button>
            <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline{% if get_tagging_options == 'subject' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="delimiter_action"
            data-api-url='edit/delimiter_action'
            data-api-attr='{"tagged_mail_handler":"subject"}'>{{ lang.user.tag_in_subject }}</button>
            <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline{% if get_tagging_options == 'none' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="delimiter_action"
            data-api-url='edit/delimiter_action'
            data-api-attr='{"tagged_mail_handler":"none"}'>{{ lang.user.tag_in_none }}</button>
          </div>
          <p class="text-muted">{{ lang.user.tag_help_explain|raw }}</p>
          <p class="text-muted">{{ lang.user.tag_help_example|raw }}</p>
        </div>
      </div>
      {# Show TLS policy options #}
      <div class="row">
        <div class="col-sm-3 col-12 text-sm-end text-start text-xs-bold mb-4">{{ lang.user.tls_policy }}:</div>
        <div class="col-sm-9 col-12">
          <div class="btn-group" data-acl="{{ acl.tls_policy }}">
            <button type="button" class="btn btn-sm btn-xs-half d-block d-sm-inline{% if get_tls_policy.tls_enforce_in == '1' %} btn-dark"{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="tls_policy"
            data-api-url='edit/tls_policy'
            data-api-attr='{"tls_enforce_in": {% if get_tls_policy.tls_enforce_in == '1' %}0{% else %}1{% endif %} }'>{{ lang.user.tls_enforce_in }}</button>
            <button type="button" class="btn btn-sm btn-xs-half d-block d-sm-inline{% if get_tls_policy.tls_enforce_out == '1' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="tls_policy"
            data-api-url='edit/tls_policy'
            data-api-attr='{"tls_enforce_out": {% if get_tls_policy.tls_enforce_out == '1' %}0{% else %}1{% endif %} }'>{{ lang.user.tls_enforce_out }}</button>
          </div>
          <p class="text-muted">{{ lang.user.tls_policy_warning|raw }}</p>
        </div>
      </div>
      {# Show quarantine_notification options #}
      <div class="row">
        <div class="col-sm-3 col-12 text-sm-end text-start text-xs-bold mb-4">{{ lang.user.quarantine_notification }}:</div>
        <div class="col-sm-9 col-12">
          <div class="btn-group" data-acl="{{ acl.quarantine_notification }}">
            <button type="button" class="btn btn-sm btn-xs-quart d-block d-sm-inline{% if quarantine_notification == 'never' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="quarantine_notification"
            data-api-url='edit/quarantine_notification'
            data-api-attr='{"quarantine_notification":"never"}'>{{ lang.user.never }}</button>
            <button type="button" class="btn btn-sm btn-xs-quart d-block d-sm-inline{% if quarantine_notification == 'hourly' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="quarantine_notification"
            data-api-url='edit/quarantine_notification'
            data-api-attr='{"quarantine_notification":"hourly"}'>{{ lang.user.hourly }}</button>
            <button type="button" class="btn btn-sm btn-xs-quart d-block d-sm-inline{% if quarantine_notification == 'daily' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="quarantine_notification"
            data-api-url='edit/quarantine_notification'
            data-api-attr='{"quarantine_notification":"daily"}'>{{ lang.user.daily }}</button>
            <button type="button" class="btn btn-sm btn-xs-quart d-block d-sm-inline{% if quarantine_notification == 'weekly' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="quarantine_notification"
            data-api-url='edit/quarantine_notification'
            data-api-attr='{"quarantine_notification":"weekly"}'>{{ lang.user.weekly }}</button>
          </div>
          <p class="text-muted">{{ lang.user.quarantine_notification_info }}</p>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-3 col-12 text-sm-end text-start text-xs-bold mb-4">{{ lang.user.quarantine_category }}:</div>
        <div class="col-sm-9 col-12">
          <div class="btn-group" data-acl="{{ acl.quarantine_category }}">
            <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline{% if quarantine_category == 'reject' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="quarantine_category"
            data-api-url='edit/quarantine_category'
            data-api-attr='{"quarantine_category":"reject"}'>{{ lang.user.q_reject }}</button>
            <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline{% if quarantine_category == 'add_header' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="quarantine_category"
            data-api-url='edit/quarantine_category'
            data-api-attr='{"quarantine_category":"add_header"}'>{{ lang.user.q_add_header }}</button>
            <button type="button" class="btn btn-sm btn-xs-third d-block d-sm-inline{% if quarantine_category == 'all' %} btn-dark{% else %} btn-light{% endif %}"
            data-action="edit_selected"
            data-item="{{ mailcow_cc_username }}"
            data-id="quarantine_category"
            data-api-url='edit/quarantine_category'
            data-api-attr='{"quarantine_category":"all"}'>{{ lang.user.q_all }}</button>
          </div>
          <p class="text-muted">{{ lang.user.quarantine_category_info }}</p>
        </div>
      </div>
      {% if not skip_sogo %}
      <hr>
      <div class="row">
        <div class="col-sm-3 col-12 text-sm-end text-start text-xs-bold mb-4">{{ lang.user.eas_reset }}:</div>
        <div class="col-sm-9 col-12">
          <button class="btn btn-sm d-block d-sm-inline btn-secondary" data-acl="{{ acl.eas_reset }}" data-action="delete_selected" data-text="{{ lang.user.eas_reset }}?" data-item="{{ mailcow_cc_username }}" data-id="eas_cache" data-api-url='delete/eas_cache' href="#">{{ lang.user.eas_reset_now }}</button>
          <p class="text-muted">{{ lang.user.eas_reset_help|raw }}</p>
        </div>
      </div>
      <div class="row">
        <div class="col-sm-3 col-12 text-sm-end text-start text-xs-bold mb-4">{{ lang.user.sogo_profile_reset }}:</div>
        <div class="col-sm-9 col-12">
          <button class="btn btn-sm d-block d-sm-inline btn-secondary" data-acl="{{ acl.sogo_profile_reset }}" data-action="delete_selected" data-text="{{ lang.user.sogo_profile_reset }}?" data-item="{{ mailcow_cc_username }}" data-id="sogo_profile" data-api-url='delete/sogo_profile' href="#">{{ lang.user.sogo_profile_reset_now }}</button>
          <p class="text-muted">{{ lang.user.sogo_profile_reset_help|raw }}</p>
        </div>
      </div>
      {% endif %}
    </div>
  </div>
</div>
