git subrepo commit mailcow/src/mailcow-dockerized

subrepo: subdir:   "mailcow/src/mailcow-dockerized"
  merged:   "308860af"
upstream: origin:   "https://github.com/mailcow/mailcow-dockerized.git"
  branch:   "master"
  commit:   "3f1a5af8"
git-subrepo: version:  "0.4.5"
  origin:   "???"
  commit:   "???"
Change-Id: I5d51c14b45db54fe706be40a591ddbfcea50d4b0
diff --git a/mailcow/src/mailcow-dockerized/data/web/templates/modals/admin.twig b/mailcow/src/mailcow-dockerized/data/web/templates/modals/admin.twig
index a545404..15971e5 100644
--- a/mailcow/src/mailcow-dockerized/data/web/templates/modals/admin.twig
+++ b/mailcow/src/mailcow-dockerized/data/web/templates/modals/admin.twig
@@ -1,40 +1,40 @@
 <!-- add settings rule modal -->
-<div class="modal fade" id="addRsettingModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+<div class="modal fade" id="addRsettingModal" tabindex="-1" role="dialog" aria-hidden="false">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.admin.add_settings_rule }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" data-id="rsetting" role="form" method="post">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="desc">{{ lang.admin.rsetting_desc }}:</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="desc">{{ lang.admin.rsetting_desc }}:</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" id="adminRspamdSettingsDesc" name="desc" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="content">{{ lang.admin.rsetting_content }}:</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="content">{{ lang.admin.rsetting_content }}:</label>
             <div class="col-sm-10">
               <textarea class="form-control" id="adminRspamdSettingsContent" name="content" rows="10"></textarea>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.admin.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="rsetting" data-api-url='add/rsetting' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="rsetting" data-api-url='add/rsetting' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
         <hr>
-        <p>{{ lang.admin.rspamd-com_settings }}</p>
+        <p>{{ lang.admin.rspamd_com_settings | raw }}</p>
         <ul id="rspamd_presets"></ul>
       </div>
     </div>
@@ -42,23 +42,23 @@
 </div><!-- add settings rule modal -->
 <!-- add domain admin modal -->
 <div class="modal fade" id="addDomainAdminModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.admin.add_domain_admin }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" data-id="add_domain_admin" role="form" method="post" autocomplete="off">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="username">{{ lang.admin.username }}:</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="username">{{ lang.admin.username }}:</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="username" onkeyup="this.value = this.value.toLowerCase();" required>
               &rdsh; <kbd>a-z - _ .</kbd>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="name">{{ lang.admin.admin_domains }}:</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="name">{{ lang.admin.admin_domains }}:</label>
             <div class="col-sm-10">
               <select title="{{ lang.admin.search_domain_da }}" class="full-width-select" name="domains" size="5" multiple>
                 {% for domain in domains %}
@@ -67,28 +67,28 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="password">{{ lang.admin.password }} (<a href="#" class="generate_password">{{ lang.admin.generate }}</a>)</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="password">{{ lang.admin.password }} (<a href="#" class="generate_password">{{ lang.admin.generate }}</a>)</label>
             <div class="col-sm-10">
               <input type="password" class="form-control" data-pwgen-field="true" data-hibp="true" name="password" placeholder="" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="password2">{{ lang.admin.password_repeat }}:</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="password2">{{ lang.admin.password_repeat }}:</label>
             <div class="col-sm-10">
               <input type="password" class="form-control" data-pwgen-field="true" name="password2" placeholder="" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.admin.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_domain_admin" data-api-url='add/domain-admin' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_domain_admin" data-api-url='add/domain-admin' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -98,25 +98,25 @@
 </div><!-- add domain admin modal -->
 <!-- change fido2 fn -->
 <div class="modal fade" id="fido2ChangeFn" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.fido2.set_fn }}</h3>
-        <p class="help-block" style="word-break:break-all" id="fido2_subject_desc" data-fido2-subject=""></p>
+        <p class="text-muted" style="word-break:break-all" id="fido2_subject_desc" data-fido2-subject=""></p>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="false" data-id="fido2ChangeFn" role="form" method="post" autocomplete="off">
           <input type="hidden" class="form-control" name="fido2_cid" id="fido2_cid">
-          <div class="form-group">
+          <div class="row mb-4">
             <label class="control-label col-sm-4" for="fido2_fn">{{ lang.fido2.fn }}:</label>
             <div class="col-sm-8">
               <input type="text" class="form-control" name="fido2_fn">
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-4 col-sm-8">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="edit_selected" data-id="fido2ChangeFn" data-item="null" data-api-url='edit/fido2-fn' data-api-attr='{}' href="#">{{ lang.admin.save }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-4 col-sm-8">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="fido2ChangeFn" data-item="null" data-api-url='edit/fido2-fn' data-api-attr='{}' href="#">{{ lang.admin.save }}</button>
             </div>
           </div>
         </form>
@@ -126,23 +126,23 @@
 </div><!-- add domain admin modal -->
 <!-- add oauth2 client modal -->
 <div class="modal fade" id="addOAuth2ClientModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">OAuth2</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" data-id="add_oauth2_client" role="form" method="post">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="redirect_uri">{{ lang.admin.oauth2_redirect_uri }}:</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="redirect_uri">{{ lang.admin.oauth2_redirect_uri }}:</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="redirect_uri" required>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_oauth2_client" data-api-url='add/oauth2-client' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_oauth2_client" data-api-url='add/oauth2-client' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -152,43 +152,43 @@
 </div><!-- add domain admin modal -->
 <!-- add admin modal -->
 <div class="modal fade" id="addAdminModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.admin.add_admin }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" data-id="add_admin" role="form" method="post" autocomplete="off">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="username">{{ lang.admin.username }}:</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="username">{{ lang.admin.username }}:</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="username" onkeyup="this.value = this.value.toLowerCase();" required>
               &rdsh; <kbd>a-z - _ .</kbd>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="password">{{ lang.admin.password }} (<a href="#" class="generate_password">{{ lang.admin.generate }}</a>):</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="password">{{ lang.admin.password }} (<a href="#" class="generate_password">{{ lang.admin.generate }}</a>):</label>
             <div class="col-sm-10">
               <input type="password" class="form-control" data-pwgen-field="true" data-hibp="true" name="password" placeholder="" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="password2">{{ lang.admin.password_repeat }}:</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="password2">{{ lang.admin.password_repeat }}:</label>
             <div class="col-sm-10">
               <input type="password" class="form-control" data-pwgen-field="true" name="password2" placeholder="" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.admin.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_admin" data-api-url='add/admin' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_admin" data-api-url='add/admin' data-api-attr='{}' href="#"><i class="bi bi-plus-lg"></i> {{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -198,32 +198,32 @@
 </div><!-- add admin modal -->
 <!-- test transport modal -->
 <div class="modal fade" id="testTransportModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title"><i class="bi bi-info-circle-fill"></i> Transport</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" id="test_transport_form" role="form" method="post">
           <input type="hidden" class="form-control" name="transport_id" id="transport_id">
           <input type="hidden" class="form-control" name="transport_type" id="transport_type">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="mail_from">{{ lang.admin.relay_from }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="mail_from">{{ lang.admin.relay_from }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="mail_from" placeholder="relay@example.org">
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="mail_rcpt">{{ lang.admin.relay_rcpt }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="mail_rcpt">{{ lang.admin.relay_rcpt }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="mail_rcpt" placeholder="null@hosted.mailcow.de" value="null@hosted.mailcow.de">
-              <p class="help-block">{{ lang.admin.transport_test_rcpt_info|raw }}</p>
+              <p class="text-muted">{{ lang.admin.transport_test_rcpt_info|raw }}</p>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="test_transport" href="#">{{ lang.admin.relay_run }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-secondary" id="test_transport" href="#">{{ lang.admin.relay_run }}</button>
             </div>
           </div>
         </form>
@@ -233,27 +233,13 @@
     </div>
   </div>
 </div><!-- test transport modal -->
-<!-- show queue item modal -->
-<div class="modal fade" id="showQueuedMsg" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
-    <div class="modal-content">
-      <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
-        <h3 class="modal-title"><i class="bi bi-card-checklist" style="font-size:18px"></i> ID <span id="queue_id"></span></h3>
-      </div>
-      <div class="modal-body">
-        <textarea class="form-control" id="queue_msg_content" name="content" rows="40"></textarea>
-      </div>
-    </div>
-  </div>
-</div><!-- show queue item modal -->
 <!-- priv key modal -->
 <div class="modal fade" id="showDKIMprivKey" tabindex="-1" role="dialog" aria-hidden="true">
   <div class="modal-dialog">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title"><i class="bi bi-key-fill"></i> Private key</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <pre id="priv_key_pre"></pre>
diff --git a/mailcow/src/mailcow-dockerized/data/web/templates/modals/footer.twig b/mailcow/src/mailcow-dockerized/data/web/templates/modals/footer.twig
index 8e5cb17..ab5630d 100644
--- a/mailcow/src/mailcow-dockerized/data/web/templates/modals/footer.twig
+++ b/mailcow/src/mailcow-dockerized/data/web/templates/modals/footer.twig
@@ -3,69 +3,69 @@
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.tfa.yubi_otp }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form role="form" method="post">
-          <div class="form-group">
+          <div class="mb-4">
             <input type="text" class="form-control" name="key_id" placeholder="{{ lang.tfa.key_id }}" autocomplete="off" required>
           </div>
           <hr>
-          <p class="help-block">{{ lang.tfa.api_register|format(ui_texts.main_name)|raw }}</p>
-          <div class="form-group">
+          <p class="text-muted">{{ lang.tfa.api_register|format(ui_texts.main_name)|raw }}</p>
+          <div class="mb-2">
             <input type="text" class="form-control" name="yubico_id" placeholder="Yubico API ID" autocomplete="off" required>
           </div>
-          <div class="form-group">
+          <div class="mb-4">
             <input type="text" class="form-control" name="yubico_key" placeholder="Yubico API Key" autocomplete="off" required>
           </div>
           <hr>
-          <div class="form-group">
+          <div class="mb-4">
             <input type="password" class="form-control" name="confirm_password" placeholder="{{ lang.user.password_now }}" autocomplete="off" required>
           </div>
-          <div class="form-group">
+          <div class="mb-4">
             <div class="input-group">
-              <span class="input-group-addon" id="yubi-addon"><img alt="Yubicon Icon" src="/img/yubi.ico"></span>
+              <span class="input-group-text" id="yubi-addon"><img alt="Yubicon Icon" src="/img/yubi.ico"></span>
               <input type="text" name="otp_token" class="form-control" placeholder="Touch Yubikey" aria-describedby="yubi-addon">
               <input type="hidden" name="tfa_method" value="yubi_otp">
             </div>
           </div>
-          <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" type="submit" name="set_tfa">{{ lang.user.save_changes }}</button>
+          <button class="btn btn-sm d-block d-sm-inline btn-success" type="submit" name="set_tfa">{{ lang.user.save_changes }}</button>
         </form>
       </div>
     </div>
   </div>
 </div>
 
-<div class="modal fade" id="U2FModal" tabindex="-1" role="dialog" aria-labelledby="U2FModalLabel">
+<div class="modal fade" id="WebAuthnModal" tabindex="-1" role="dialog" aria-labelledby="WebAuthnModalLabel">
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
-        <h3 class="modal-title">{{ lang.tfa.u2f }}</h3>
+        <h3 class="modal-title">{{ lang.tfa.webauthn }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
-        <form role="form" method="post" id="u2f_reg_form">
-          <div class="form-group">
+        <form class="d-flex flex-column" role="form" method="post" id="webauthn_reg_form">
+          <div class="mb-2">
             <input type="text" class="form-control" name="key_id" placeholder="{{ lang.tfa.key_id }}" autocomplete="off" required>
           </div>
-          <div class="form-group">
+          <div class="mb-4">
             <input type="password" class="form-control" name="confirm_password" placeholder="{{ lang.user.password_now }}" autocomplete="off" required>
           </div>
           <hr>
-          <center>
-            <div style="cursor:pointer" id="start_u2f_register">
+          <div class="text-center">
+            <div style="cursor:pointer" id="start_webauthn_register">
               <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24">
                 <path d="M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12.01 2c2.13 0 3.99.47 6.03 1.52.25.13.34.43.21.67-.09.18-.26.28-.44.28zM3.5 9.72c-.1 0-.2-.03-.29-.09-.23-.16-.28-.47-.12-.7.99-1.4 2.25-2.5 3.75-3.27C9.98 4.04 14 4.03 17.15 5.65c1.5.77 2.76 1.86 3.75 3.25.16.22.11.54-.12.7-.23.16-.54.11-.7-.12-.9-1.26-2.04-2.25-3.39-2.94-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5 1.7-3.4 2.96-.08.14-.23.21-.39.21zm6.25 12.07c-.13 0-.26-.05-.35-.15-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34 0-2.97 2.54-5.39 5.66-5.39s5.66 2.42 5.66 5.39c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39-2.57 0-4.66 1.97-4.66 4.39 0 1.44.32 2.77.93 3.85.64 1.15 1.08 1.64 1.85 2.42.19.2.19.51 0 .71-.11.1-.24.15-.37.15zm7.17-1.85c-1.19 0-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39 0-.28.22-.5.5-.5s.5.22.5.5c0 1.41.72 2.74 1.94 3.56.71.48 1.54.71 2.54.71.24 0 .64-.03 1.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12zM14.91 22c-.04 0-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1-1.4-1.39-2.17-3.24-2.17-5.22 0-1.62 1.38-2.94 3.08-2.94 1.7 0 3.08 1.32 3.08 2.94 0 1.07.93 1.94 2.08 1.94s2.08-.87 2.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84 0-5.44 1.58-6.61 4.03-.39.81-.59 1.76-.59 2.8 0 .78.07 2.01.67 3.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29-.49-1.31-.73-2.61-.73-3.96 0-1.2.23-2.29.68-3.24 1.33-2.79 4.28-4.6 7.51-4.6 4.55 0 8.25 3.51 8.25 7.83 0 1.62-1.38 2.94-3.08 2.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08 1.94c0 1.71.66 3.31 1.87 4.51.95.94 1.86 1.46 3.27 1.85.27.07.42.35.35.61-.05.23-.26.38-.47.38z"></path>
               </svg>
-              <p>{{ lang.tfa.start_u2f_validation }}</p>
-              <hr>
+              <p>{{ lang.tfa.start_webauthn_validation }}</p>
             </div>
-          </center>
-          <p id="u2f_status_reg"></p>
-          <div class="alert alert-danger" style="display:none" id="u2f_return_code"></div>
-          <input type="hidden" name="token" id="u2f_register_data"/>
-          <input type="hidden" name="tfa_method" value="u2f">
+          </div>
+          <hr>
+          <p id="webauthn_status_reg"></p>
+          <div class="alert alert-danger" style="display:none" id="webauthn_return_code"></div>
+          <input type="hidden" name="token" id="webauthn_register_data"/>
+          <input type="hidden" name="tfa_method" value="webauthn">
           <input type="hidden" name="set_tfa"/><br/>
         </form>
       </div>
@@ -77,32 +77,32 @@
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.tfa.totp }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form role="form" method="post">
-          <div class="form-group">
+          <div class="mb-2">
             <input type="text" class="form-control" name="key_id" placeholder="{{ lang.tfa.key_id_totp }}" autocomplete="off" required>
           </div>
-          <div class="form-group">
+          <div class="mb-4">
             <input type="password" class="form-control" name="confirm_password" placeholder="{{ lang.user.password_now }}" autocomplete="off" required>
           </div>
           <hr>
           <input type="hidden" value="{{ totp_secret }}" name="totp_secret">
           <input type="hidden" name="tfa_method" value="totp">
-          <ol>
+          <ol class="mb-4">
             <li>
               <p>{{ lang.tfa.scan_qr_code }}</p>
               <img id="tfa-qr-img" data-totp-secret="{{ totp_secret }}" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=">
-              <p class="help-block">{{ lang.tfa.enter_qr_code }}:<br />
+              <p class="text-muted">{{ lang.tfa.enter_qr_code }}:<br />
                 <code>{{ totp_secret }}</code>
               </p>
             </li>
             <li>
               <p>{{ lang.tfa.confirm_totp_token }}:</p>
               <p><input type="number" style="width:33%" class="form-control" name="totp_confirm_token" autocomplete="off" required></p>
-              <p><button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" type="submit" name="set_tfa">{{ lang.tfa.confirm }}</button></p>
+              <p><button class="btn btn-sm d-block d-sm-inline btn-success" type="submit" name="set_tfa">{{ lang.tfa.confirm }}</button></p>
             </li>
           </ol>
         </form>
@@ -115,78 +115,197 @@
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.tfa.delete_tfa }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form role="form" method="post">
           <div class="input-group">
-            <input type="password" class="form-control input-xs-lg" name="confirm_password" placeholder="{{ lang.user.password_now }}" autocomplete="off" required>
-            <span class="input-group-btn">
-              <input type="hidden" name="tfa_method" value="none">
-              <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-danger" type="submit" name="set_tfa">{{ lang.tfa.delete_tfa|replace({" ": "&nbsp;"})|raw }}</button>
-            </span>
+            <input type="password" class="form-control" name="confirm_password" placeholder="{{ lang.user.password_now }}" autocomplete="off" required>
+            <button class="btn btn-sm d-block d-sm-inline btn-danger" type="submit" name="set_tfa">{{ lang.tfa.delete_tfa|replace({" ": "&nbsp;"})|raw }}</button>
           </div>
+          <input type="hidden" name="tfa_method" value="none">
         </form>
       </div>
     </div>
   </div>
 </div>
 {% endif %}
-{% if pending_tfa_method %}
+{% if pending_tfa_methods %}
 <div class="modal fade" id="ConfirmTFAModal" tabindex="-1" role="dialog" aria-labelledby="ConfirmTFAModalLabel">
   <div class="modal-dialog" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
-        <h3 class="modal-title">{{ lang.tfa[pending_tfa_method] }}</h3>
+        <h3 class="modal-title">{{ lang.tfa.tfa }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
-      <div class="modal-body">
-        {% if pending_tfa_method == 'yubi_otp' %}
-        <form role="form" method="post">
-          <div class="form-group">
-            <div class="input-group">
-              <span class="input-group-addon" id="yubi-addon"><img alt="Yubicon Icon" src="/img/yubi.ico"></span>
-              <input type="text" name="token" class="form-control" autocomplete="off" placeholder="Touch Yubikey" aria-describedby="yubi-addon">
-              <input type="hidden" name="tfa_method" value="yubi_otp">
+      
+      
+      <div class="modal-body p-0 pt-4">
+        <ul class="nav nav-tabs px-1" id="tabContent">
+            {% if pending_tfa_authmechs["webauthn"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
+              <li class="nav-item"><a class="nav-link active" href="#tfa_tab_webauthn" data-bs-toggle="tab" id="pending_tfa_tab_webauthn"><i class="bi bi-fingerprint"></i> WebAuthn</a></li>
+            {% endif %}
+
+            {% if pending_tfa_authmechs["yubi_otp"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
+              <li class="nav-item">
+                <a class="nav-link {% if pending_tfa_authmechs["yubi_otp"] %}active{% endif %}" href="#tfa_tab_yubi_otp" data-bs-toggle="tab" id="pending_tfa_tab_yubi_otp"><i class="bi bi-usb-drive"></i> Yubi OTP</a>
+              </li>
+            {% endif %}
+
+            {% if pending_tfa_authmechs["totp"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
+              <li class="nav-item">
+                <a class="nav-link {% if pending_tfa_authmechs["totp"] %}active{% endif %}" href="#tfa_tab_totp" data-bs-toggle="tab" id="pending_tfa_tab_totp"><i class="bi bi-clock-history"></i> Time based OTP</a>
+              </li>
+            {% endif %}
+
+            <!-- <li class="nav-item"><a class="nav-link" href="#tfa_tab_hotp" data-bs-toggle="tab">HOTP</a></li> -->
+            {% if pending_tfa_authmechs["u2f"] is defined %}
+              <li class="nav-item"><a class="nav-link active" href="#tfa_tab_u2f" data-bs-toggle="tab"><i class="bi bi-x-octagon"></i> U2F</a></li>
+            {% endif %}
+        </ul>
+
+        <div class="tab-content">
+          {% if pending_tfa_authmechs["webauthn"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
+            <div role="tabpanel" class="tab-pane active" id="tfa_tab_webauthn">
+              <div class="card border-0" style="margin-bottom: 0px;">
+                  <div class="card-body">
+                    <form role="form" method="post" id="webauthn_auth_form">
+                      <legend class="mt-2 mb-2">
+                          <i class="bi bi-shield-fill-check"></i>
+                          Authenticators
+                          <hr />
+                      </legend>
+                      <div class="list-group">
+                        {% for authenticator in pending_tfa_methods %}
+                          {% if authenticator["authmech"] == "webauthn" %}
+                            <a href="#" class="list-group-item webauthn-authenticator-selection">
+                              <i class="bi bi-key-fill" style="margin-right: 5px"></i>
+                              <span>{{ authenticator["key_id"] }}</span>
+                              <input type="hidden" value="{{ authenticator["id"] }}" /><br/>
+                            </a>
+                          {% endif %}
+                        {% endfor %}
+                      </div>
+                      <div class="collapse pending-tfa-collapse" id="collapseWebAuthnTFA">
+                        <div class="row mt-4 mb-4">
+                          <div class="col-12">
+                            <div class="mt-4 d-flex align-items-center" id="webauthn_status_auth">
+                              <div class="spinner-border me-2" role="status">
+                                <span class="visually-hidden">Loading...</span>
+                              </div>
+                              {{ lang.tfa.init_webauthn }}
+                            </div>
+                            <div class="mt-4 alert alert-danger" style="display:none" id="webauthn_return_code"></div>
+                          </div>
+                        </div>
+                      </div>
+                      <input type="hidden" name="token" id="webauthn_auth_data"/>
+                      <input type="hidden" name="tfa_method" value="webauthn">
+                      <input type="hidden" name="verify_tfa_login"/>
+                      <input type="hidden" name="id" id="webauthn_selected_id" /><br/>
+                    </form>
+                  </div>
+              </div>
             </div>
-          </div>
-          <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-sm btn-default" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
-        </form>
-        {% endif %}
-        {% if pending_tfa_method == 'u2f' %}
-        <form role="form" method="post" id="u2f_auth_form">
-          <center>
-            <div id="start_u2f_confirmation">
-              <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24">
-                <path d="M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12.01 2c2.13 0 3.99.47 6.03 1.52.25.13.34.43.21.67-.09.18-.26.28-.44.28zM3.5 9.72c-.1 0-.2-.03-.29-.09-.23-.16-.28-.47-.12-.7.99-1.4 2.25-2.5 3.75-3.27C9.98 4.04 14 4.03 17.15 5.65c1.5.77 2.76 1.86 3.75 3.25.16.22.11.54-.12.7-.23.16-.54.11-.7-.12-.9-1.26-2.04-2.25-3.39-2.94-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5 1.7-3.4 2.96-.08.14-.23.21-.39.21zm6.25 12.07c-.13 0-.26-.05-.35-.15-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34 0-2.97 2.54-5.39 5.66-5.39s5.66 2.42 5.66 5.39c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39-2.57 0-4.66 1.97-4.66 4.39 0 1.44.32 2.77.93 3.85.64 1.15 1.08 1.64 1.85 2.42.19.2.19.51 0 .71-.11.1-.24.15-.37.15zm7.17-1.85c-1.19 0-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39 0-.28.22-.5.5-.5s.5.22.5.5c0 1.41.72 2.74 1.94 3.56.71.48 1.54.71 2.54.71.24 0 .64-.03 1.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12zM14.91 22c-.04 0-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1-1.4-1.39-2.17-3.24-2.17-5.22 0-1.62 1.38-2.94 3.08-2.94 1.7 0 3.08 1.32 3.08 2.94 0 1.07.93 1.94 2.08 1.94s2.08-.87 2.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84 0-5.44 1.58-6.61 4.03-.39.81-.59 1.76-.59 2.8 0 .78.07 2.01.67 3.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29-.49-1.31-.73-2.61-.73-3.96 0-1.2.23-2.29.68-3.24 1.33-2.79 4.28-4.6 7.51-4.6 4.55 0 8.25 3.51 8.25 7.83 0 1.62-1.38 2.94-3.08 2.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08 1.94c0 1.71.66 3.31 1.87 4.51.95.94 1.86 1.46 3.27 1.85.27.07.42.35.35.61-.05.23-.26.38-.47.38z"></path>
-              </svg>
-              <p>{{ lang.tfa.start_u2f_validation }}</p>
-              <hr>
+          {% endif %}
+          {% if pending_tfa_authmechs["yubi_otp"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
+            <div role="tabpanel" class="tab-pane {% if pending_tfa_authmechs["yubi_otp"] %}active{% endif %}" id="tfa_tab_yubi_otp">
+              <div class="card border-0" style="margin-bottom: 0px;">
+                  <div class="card-body">
+                    <form role="form" method="post">
+                      <legend class="mt-2 mb-2">
+                          <i class="bi bi-shield-fill-check"></i>
+                          Authenticate
+                          <hr />
+                      </legend>
+                      <div class="collapse show pending-tfa-collapse" id="collapseYubiTFA">
+                        <div class="row mt-4 mb-4">
+                          <div class="col-12">
+                            <div class="input-group mt-4">
+                              <span class="input-group-text" id="yubi-addon"><img alt="Yubicon Icon" src="/img/yubi.ico"></span>
+                              <input type="text" name="token" class="form-control" autocomplete="off" placeholder="Touch Yubikey" aria-describedby="yubi-addon">
+                              <input type="hidden" name="tfa_method" value="yubi_otp">
+                              <input type="hidden" name="id" id="yubi_selected_id" />
+                            </div>
+                          </div>
+                        </div>
+                        <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-secondary" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
+                      </div>
+                    </form>
+                  </div>
+              </div>
             </div>
-          </center>
-          <p id="u2f_status_auth"></p>
-          <div class="alert alert-danger" style="display:none" id="u2f_return_code"></div>
-          <input type="hidden" name="token" id="u2f_auth_data"/>
-          <input type="hidden" name="tfa_method" value="u2f">
-          <input type="hidden" name="verify_tfa_login"/><br/>
-        </form>
-        {% endif %}
-        {% if pending_tfa_method == 'totp' %}
-        <form role="form" method="post">
-          <div class="form-group">
-            <div class="input-group">
-              <span class="input-group-addon" id="tfa-addon"><i class="bi bi-shield-lock-fill"></i></span>
-              <input type="number" min="000000" max="999999" name="token" class="form-control" placeholder="123456" autocomplete="one-time-code" aria-describedby="tfa-addon">
-              <input type="hidden" name="tfa_method" value="totp">
+          {% endif %}
+          {% if pending_tfa_authmechs["totp"] is defined and pending_tfa_authmechs["u2f"] is not defined %}
+            <div role="tabpanel" class="tab-pane {% if pending_tfa_authmechs["totp"] %}active{% endif %}" id="tfa_tab_totp">
+              <div class="card border-0" style="margin-bottom: 0px;">
+                  <div class="card-body">
+                    <form role="form" method="post">        
+                      <legend class="mt-2 mb-2">
+                          <i class="bi bi-shield-fill-check"></i>
+                          Authenticators
+                          <hr />
+                      </legend>
+                      <div class="list-group">
+                        {% for authenticator in pending_tfa_methods %}
+                          {% if authenticator["authmech"] == "totp" %}
+                            <a href="#" class="list-group-item totp-authenticator-selection">
+                              <i class="bi bi-key-fill" style="margin-right: 5px"></i>
+                              <span>{{ authenticator["key_id"] }}</span>
+                              <input type="hidden" value="{{ authenticator["id"] }}" />
+                            </a>
+                          {% endif %}
+                        {% endfor %}
+                      </div>
+                      <div class="collapse pending-tfa-collapse" id="collapseTotpTFA">
+                        <div class="row mt-4 mb-4">
+                          <div class="col-12">
+                            <div class="input-group mt-4">
+                              <span class="input-group-text" id="tfa-addon"><i class="bi bi-shield-lock-fill"></i></span>
+                              <input type="number" min="000000" max="999999" name="token" class="form-control" placeholder="123456" autocomplete="one-time-code" aria-describedby="tfa-addon">
+                              <input type="hidden" name="tfa_method" value="totp">
+                              <input type="hidden" name="id" id="totp_selected_id" /><br/>
+                            </div>
+                            <button class="mt-4 btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-secondary" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
+                          </div>
+                        </div>
+                      </div>
+                    </form>
+                  </div>
+              </div>
             </div>
-          </div>
-          <button class="btn btn-sm visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" type="submit" name="verify_tfa_login">{{ lang.login.login }}</button>
-        </form>
-        {% endif %}
-        {% if pending_tfa_method == 'hotp' %}
-        <div class="empty"></div>
-        {% endif %}
+          {% endif %}
+            <!--
+            <div role="tabpanel" class="tab-pane" id="tfa_tab_hotp">
+              <div class="card" style="margin-bottom: 0px;">
+                  <div class="card-body">
+                      <div class="empty"></div>
+                  </div>
+              </div>
+            </div>
+            -->
+          {% if pending_tfa_authmechs["u2f"] is defined %}
+            <div role="tabpanel" class="tab-pane active" id="tfa_tab_u2f">
+              <div class="card border-0" style="margin-bottom: 0px;">
+                  <div class="card-body">
+                    {# leave this here to inform users that u2f is deprecated #}
+                    <form role="form" method="post" id="u2f_auth_form">
+                      <div>
+                        <p>{{ lang.tfa.u2f_deprecated }}</p>
+                        <p><b>{{ lang.tfa.u2f_deprecated_important }}</b></p>
+                        <input type="hidden" name="token" value="destroy" />
+                        <input type="hidden" name="tfa_method" value="u2f">
+                        <input type="hidden" name="verify_tfa_login"/><br/>
+                        <button type="submit" class="btn btn-xs-lg btn-success" value="Login">{{ lang.login.login }}</button>
+                      </div>
+                    </form>
+                  </div>
+              </div>
+            </div>
+          {% endif %}
+        </div>
+
       </div>
     </div>
   </div>
@@ -197,13 +316,13 @@
   <div class="modal-dialog">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h4 class="modal-title">{{ lang.footer.restart_container }} (<code id="containerName"></code>)</h4>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <p>{{ lang.footer.restart_container_info|raw }}</p>
         <hr>
-        <button class="btn btn-md visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-primary" id="triggerRestartContainer">{{ lang.footer.restart_now }}</button>
+        <button class="btn btn-md d-block d-sm-inline btn-primary" id="triggerRestartContainer">{{ lang.footer.restart_now }}</button>
         <br><br>
         <div id="statusTriggerRestartContainer"></div>
       </div>
@@ -215,17 +334,32 @@
   <div class="modal-dialog">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.footer.confirm_delete }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <p id="DeleteText">{{ lang.footer.delete_these_items }}</p>
         <ul id="ItemsToDelete"></ul>
         <hr>
-        <button class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-danger" id="IsConfirmed">{{ lang.footer.delete_now }}</button>
-        <button class="btn btn-sm btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" id="isCanceled">{{ lang.footer.cancel }}</button>
-        <div class="clearfix visible-xs"></div>
+        <button class="btn btn-sm btn-xs-half d-block d-sm-inline btn-danger" id="IsConfirmed">{{ lang.footer.delete_now }}</button>
+        <button class="btn btn-sm btn-xs-half d-block d-sm-inline btn-secondary" id="isCanceled">{{ lang.footer.cancel }}</button>
       </div>
     </div>
   </div>
 </div>
+<!-- version modal -->
+<div class="modal fade" id="showVersionModal" tabindex="-1" role="dialog" aria-hidden="true">
+  <div class="modal-dialog modal-lg">
+    <div class="modal-content">
+      <div class="modal-header">
+        <h5 class="modal-title"></h5>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
+      </div>
+      <div class="modal-body d-flex flex-column mt-2 p-4">
+        <div class="spinner-border mx-auto" role="status">
+          <span class="visually-hidden">Loading...</span>
+        </div>
+      </div>
+    </div>
+  </div>
+</div><!-- version modal -->
diff --git a/mailcow/src/mailcow-dockerized/data/web/templates/modals/mailbox.twig b/mailcow/src/mailcow-dockerized/data/web/templates/modals/mailbox.twig
index 279e4c9..25185de 100644
--- a/mailcow/src/mailcow-dockerized/data/web/templates/modals/mailbox.twig
+++ b/mailcow/src/mailcow-dockerized/data/web/templates/modals/mailbox.twig
@@ -1,21 +1,25 @@
 <!-- add mailbox modal -->
 <div class="modal fade" id="addMailboxModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.mailbox.add_mailbox }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" data-id="add_mailbox" role="form" autocomplete="off">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="local_part">{{ lang.add.mailbox_username }}</label>
+          <input type="hidden" value="0" name="force_pw_update">
+          <input type="hidden" value="0" name="sogo_access">
+          <input type="hidden" value="0" name="protocol_access">
+
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="local_part">{{ lang.add.mailbox_username }}</label>
             <div class="col-sm-10">
               <input type="text" pattern="[A-Za-z0-9\.!#$%&'*+/=?^_`{|}~-]+" autocorrect="off" autocapitalize="none" class="form-control" name="local_part" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="domain">{{ lang.add.domain }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="domain">{{ lang.add.domain }}</label>
             <div class="col-sm-10">
               <select class="full-width-select" data-live-search="true" id="addSelectDomain" name="domain" required>
                 {% for domain in domains %}
@@ -24,47 +28,174 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="name">{{ lang.add.full_name }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="name">{{ lang.add.full_name }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="name">
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="addInputQuota">{{ lang.add.quota_mb }}
-              <br /><span id="quotaBadge" class="badge">max. - MiB</span>
-            </label>
-            <div class="col-sm-10">
-              <input type="text" class="form-control" name="quota" min="0" max="" id="addInputQuota" disabled value="{{ lang.add.select_domain }}" required>
-              <small class="help-block">0 = ∞</small>
-              <div class="label label-warning addInputQuotaExhausted" style="display:none;">{{ lang.warning.quota_exceeded_scope }}</div>
-            </div>
-          </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="password">{{ lang.add.password }} (<a href="#" class="generate_password">{{ lang.add.generate }}</a>)</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="password">{{ lang.add.password }} (<a href="#" class="generate_password">{{ lang.add.generate }}</a>)</label>
             <div class="col-sm-10">
               <input type="password" data-pwgen-field="true" data-hibp="true" class="form-control" name="password" placeholder="" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="password2">{{ lang.add.password_repeat }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="password2">{{ lang.add.password_repeat }}</label>
             <div class="col-sm-10">
               <input type="password" data-pwgen-field="true" class="form-control" name="password2" placeholder="" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <select name="active" class="form-control">
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="description">{{ lang.mailbox.template }}</label>
+            <div class="col-sm-10">
+              <select data-live-search="true" id="mailbox_templates" class="form-control" title="{{ lang.mailbox.template }}">
+              </select>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.add.tags }}</label>
+            <div class="col-sm-10">
+              <div class="form-control tag-box">
+                <input type="text" class="tag-input" id="addMailbox_tags">
+                <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span>
+                <input type="hidden" value="" name="tags" class="tag-values" />
+              </div>
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="addInputQuota">{{ lang.add.quota_mb }}
+              <br /><span id="quotaBadge" class="badge bg-primary">max. - MiB</span>
+            </label>
+            <div class="col-sm-10">
+              <input type="text" class="form-control" name="quota" min="0" max="" id="addInputQuota" disabled value="{{ lang.add.select_domain }}" required>
+              <small class="text-muted">0 = ∞</small>
+              <div class="badge fs-5 bg-warning addInputQuotaExhausted" style="display:none;">{{ lang.warning.quota_exceeded_scope }}</div>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.user.quarantine_notification }}</label>
+            <div class="col-sm-10">
+              <div class="btn-group">
+                <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_never" autocomplete="off" value="never">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_notification_never">{{ lang.user.never }}</label>
+
+                <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_hourly" autocomplete="off" value="hourly">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_notification_hourly">{{ lang.user.hourly }}</label>
+
+                <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_daily" autocomplete="off" value="daily">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_notification_daily">{{ lang.user.daily }}</label>
+
+                <input type="radio" class="btn-check" name="quarantine_notification" id="quarantine_notification_weekly" autocomplete="off" value="weekly">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_notification_weekly">{{ lang.user.weekly }}</label>
+              </div>
+              <p class="text-muted"><small>{{ lang.user.quarantine_notification_info }}</small></p>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.user.quarantine_category }}</label>
+            <div class="col-sm-10">
+              <div class="btn-group">
+                <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_reject" autocomplete="off" value="reject">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_category_reject">{{ lang.user.q_reject }}</label>
+                
+                <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_add_header" autocomplete="off" value="add_header">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_category_add_header">{{ lang.user.q_add_header }}</label>
+                
+                <input type="radio" class="btn-check" name="quarantine_category" id="quarantine_category_all" autocomplete="off" value="all">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="quarantine_category_all">{{ lang.user.q_all }}</label>
+              </div>
+              <p class="text-muted"><small>{{ lang.user.quarantine_category_info }}</small></p>
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="tls_enforce_in">{{ lang.user.tls_policy }}</label>
+            <div class="col-sm-10">
+              <div class="btn-group">
+                <input type="checkbox" class="btn-check" name="tls_enforce_in" id="tls_enforce_in" autocomplete="off" value="1">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="tls_enforce_in">{{ lang.user.tls_enforce_in }}</label>
+                
+                <input type="checkbox" class="btn-check" name="tls_enforce_out" id="tls_enforce_out" autocomplete="off" value="1">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="tls_enforce_out">{{ lang.user.tls_enforce_out }}</label>
+              </div>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="protocol_access">{{ lang.edit.allowed_protocols }}</label>
+            <div class="col-sm-10">
+              <select name="protocol_access" id="protocol_access" multiple class="form-control">
+                <option value="imap">IMAP</option>
+                <option value="pop3">POP3</option>
+                <option value="smtp">SMTP</option>
+                <option value="sieve">Sieve</option>
+              </select>
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">ACL</label>
+            <div class="col-sm-10">
+              <select id="user_acl" name="acl" multiple class="form-control">
+                  <option value="spam_alias" selected>{{ lang.acl["spam_alias"] }}</option>
+                  <option value="tls_policy" selected>{{ lang.acl["tls_policy"] }}</option>
+                  <option value="spam_score" selected>{{ lang.acl["spam_score"] }}</option>
+                  <option value="spam_policy" selected>{{ lang.acl["spam_policy"] }}</option>
+                  <option value="delimiter_action" selected>{{ lang.acl["delimiter_action"] }}</option>
+                  <option value="syncjobs">{{ lang.acl["syncjobs"] }}</option>
+                  <option value="eas_reset" selected>{{ lang.acl["eas_reset"] }}</option>
+                  <option value="sogo_profile_reset">{{ lang.acl["sogo_profile_reset"] }}</option>
+                  <option value="pushover" selected>{{ lang.acl["pushover"] }}</option>
+                  <option value="quarantine" selected>{{ lang.acl["quarantine"] }}</option>
+                  <option value="quarantine_attachments" selected>{{ lang.acl["quarantine_attachments"] }}</option>
+                  <option value="quarantine_notification" selected>{{ lang.acl["quarantine_notification"] }}</option>
+                  <option value="quarantine_category" selected>{{ lang.acl["quarantine_category"] }}</option>
+                  <option value="app_passwds" selected>{{ lang.acl["app_passwds"] }}</option>
+              </select>
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.acl.ratelimit }}</label>
+            <div class="col-sm-10">
+              <input name="rl_value" id="rl_value" type="number" autocomplete="off" value="" class="form-control mb-2" placeholder="{{ lang.ratelimit.disabled }}">
+              <select name="rl_frame" id="rl_frame" class="form-control">
+                <option value="s">{{ lang.ratelimit.second }}</option>
+                <option value="m">{{ lang.ratelimit.minute }}</option>
+                <option value="h">{{ lang.ratelimit.hour }}</option>
+                <option value="d">{{ lang.ratelimit.day }}</option>
+              </select>
+              <p class="text-muted mt-3">{{ lang.edit.mbox_rl_info }}</p>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
+              <select name="active" id="mbox_active" class="form-control">
                 <option value="1" selected>{{ lang.add.active }}</option>
                 <option value="2">{{ lang.add.disable_login }}</option>
                 <option value="0">{{ lang.add.inactive }}</option>
               </select>
             </div>
           </div>
+          <div class="row">
+            <div class="offset-sm-2 col-sm-10">
+              <div class="checkbox">
+                <label><input type="checkbox" value="1" name="force_pw_update" id="force_pw_update"> {{ lang.edit.force_pw_update }}</label>
+                <small class="text-muted">{{ lang.edit.force_pw_update_info|format(ui_texts.main_name) }}</small>
+              </div>
+            </div>
+          </div>
+          {% if not skip_sogo %}
+          <div class="row">
+            <div class="offset-sm-2 col-sm-10">
+              <div class="checkbox">
+                <label><input type="checkbox" value="1" name="sogo_access" id="sogo_access"> {{ lang.edit.sogo_access }}</label>
+                <small class="text-muted">{{ lang.edit.sogo_access_info }}</small>
+              </div>
+            </div>
+          </div>
+          {% endif %}
           <hr>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_mailbox" data-api-url='add/mailbox' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_mailbox" data-api-url='add/mailbox' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -72,127 +203,314 @@
     </div>
   </div>
 </div><!-- add mailbox modal -->
-<!-- add domain modal -->
-<div class="modal fade" id="addDomainModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+<!-- add mailbox template modal -->
+<div class="modal fade" id="addMailboxTemplateModal" tabindex="-1" role="dialog" aria-hidden="true">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
-        <h3 class="modal-title">{{ lang.mailbox.add_domain }}</h3>
+        <h3 class="modal-title">{{ lang.mailbox.add_template }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
-        <form class="form-horizontal" data-cached-form="true" data-id="add_domain" role="form">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="domain">{{ lang.add.domain }}</label>
+        <form class="form-horizontal" data-id="addmailbox_template" role="form" method="post">
+          <input type="hidden" value="default" name="sender_acl">
+          <input type="hidden" value="0" name="force_pw_update">
+          <input type="hidden" value="0" name="sogo_access">
+          <input type="hidden" value="0" name="protocol_access">     
+
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="template">{{ lang.mailbox.template }}</label>
             <div class="col-sm-10">
-              <input type="text" autocorrect="off" autocapitalize="none" class="form-control" name="domain" required>
+              <div class="input-group mb-3">
+                <input type="text" name="template" class="form-control" aria-label="Text input with dropdown button" value="" />
+              </div>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="description">{{ lang.add.description }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.add.tags }}</label>
             <div class="col-sm-10">
-              <input type="text" class="form-control" name="description">
+              <div class="form-control tag-box">
+                <input type="text" class="tag-input" id="addMailbox_tags">
+                <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span>
+                <input type="hidden" value="" name="tags" class="tag-values" />
+              </div>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="aliases">{{ lang.add.max_aliases }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="quota">{{ lang.edit.quota_mb }}</label>
             <div class="col-sm-10">
-              <input type="number" class="form-control" name="aliases" value="400" required>
+              <input type="number" name="quota" style="width:100%" min="0" value="" class="form-control">
+              <small class="text-muted">0 = ∞</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="mailboxes">{{ lang.add.max_mailboxes }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.user.quarantine_notification }}</label>
             <div class="col-sm-10">
-              <input type="number" class="form-control" name="mailboxes" value="10" required>
+              <div class="btn-group">
+                <input type="radio" class="btn-check" name="quarantine_notification" id="template_quarantine_notification_never" autocomplete="off" value="never">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_quarantine_notification_never">{{ lang.user.never }}</label>
+
+                <input type="radio" class="btn-check" name="quarantine_notification" id="template_quarantine_notification_hourly" autocomplete="off" value="hourly">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_quarantine_notification_hourly">{{ lang.user.hourly }}</label>
+
+                <input type="radio" class="btn-check" name="quarantine_notification" id="template_quarantine_notification_daily" autocomplete="off" value="daily">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_quarantine_notification_daily">{{ lang.user.daily }}</label>
+
+                <input type="radio" class="btn-check" name="quarantine_notification" id="template_quarantine_notification_weekly" autocomplete="off" value="weekly">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_quarantine_notification_weekly">{{ lang.user.weekly }}</label>
+              </div>
+              <p class="text-muted"><small>{{ lang.user.quarantine_notification_info }}</small></p>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="defquota">{{ lang.add.mailbox_quota_def }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.user.quarantine_category }}</label>
             <div class="col-sm-10">
-              <input type="number" class="form-control" name="defquota" value="3072" required>
+              <div class="btn-group">
+                <input type="radio" class="btn-check" name="quarantine_category" id="template_quarantine_category_reject" autocomplete="off" value="reject" >
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_quarantine_category_reject">{{ lang.user.q_reject }}</label>
+                
+                <input type="radio" class="btn-check" name="quarantine_category" id="template_quarantine_category_add_header" autocomplete="off" value="add_header">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_quarantine_category_add_header">{{ lang.user.q_add_header }}</label>
+                
+                <input type="radio" class="btn-check" name="quarantine_category" id="template_quarantine_category_all" autocomplete="off" value="all">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_quarantine_category_all">{{ lang.user.q_all }}</label>
+              </div>
+              <p class="text-muted"><small>{{ lang.user.quarantine_category_info }}</small></p>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="maxquota">{{ lang.add.mailbox_quota_m }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="sender_acl">{{ lang.user.tls_policy }}</label>
             <div class="col-sm-10">
-              <input type="number" class="form-control" name="maxquota" value="10240" required>
+              <div class="btn-group">
+                <input type="checkbox" class="btn-check" name="tls_enforce_in" id="template_tls_enforce_in" autocomplete="off" value="1">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_tls_enforce_in">{{ lang.user.tls_enforce_in }}</label>
+                
+                <input type="checkbox" class="btn-check" name="tls_enforce_out" id="template_tls_enforce_out" autocomplete="off" value="1">
+                <label class="btn btn-sm btn-xs-quart d-block d-sm-inline btn-secondary" for="template_tls_enforce_out">{{ lang.user.tls_enforce_out }}</label>
+              </div>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="quota">{{ lang.add.domain_quota_m }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="protocol_access">{{ lang.edit.allowed_protocols }}</label>
             <div class="col-sm-10">
-              <input type="number" class="form-control" name="quota" value="10240" required>
+              <select name="protocol_access" multiple class="form-control">
+                <option value="imap" selected>IMAP</option>
+                <option value="pop3" selected>POP3</option>
+                <option value="smtp" selected>SMTP</option>
+                <option value="sieve" selected>Sieve</option>
+              </select>
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">ACL</label>
+            <div class="col-sm-10">
+              <select id="template_user_acl" name="acl" size="10" multiple class="form-control">                  
+                <option value="spam_alias" selected>{{ lang.acl["spam_alias"] }}</option>
+                <option value="tls_policy" selected>{{ lang.acl["tls_policy"] }}</option>
+                <option value="spam_score" selected>{{ lang.acl["spam_score"] }}</option>
+                <option value="spam_policy" selected>{{ lang.acl["spam_policy"] }}</option>
+                <option value="delimiter_action" selected>{{ lang.acl["delimiter_action"] }}</option>
+                <option value="syncjobs">{{ lang.acl["syncjobs"] }}</option>
+                <option value="eas_reset" selected>{{ lang.acl["eas_reset"] }}</option>
+                <option value="sogo_profile_reset">{{ lang.acl["sogo_profile_reset"] }}</option>
+                <option value="pushover" selected>{{ lang.acl["pushover"] }}</option>
+                <option value="quarantine" selected>{{ lang.acl["quarantine"] }}</option>
+                <option value="quarantine_attachments" selected>{{ lang.acl["quarantine_attachments"] }}</option>
+                <option value="quarantine_notification" selected>{{ lang.acl["quarantine_notification"] }}</option>
+                <option value="quarantine_category" selected>{{ lang.acl["quarantine_category"] }}</option>
+                <option value="app_passwds" selected>{{ lang.acl["app_passwds"] }}</option>
+              </select>
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.acl.ratelimit }}</label>
+            <div class="col-sm-10">
+              <input name="rl_value" type="number" autocomplete="off" value="" class="form-control mb-2" placeholder="{{ lang.ratelimit.disabled }}">
+              <select name="rl_frame" class="form-control">
+                <option value="s">{{ lang.ratelimit.second }}</option>
+                <option value="m">{{ lang.ratelimit.minute }}</option>
+                <option value="h">{{ lang.ratelimit.hour }}</option>
+                <option value="d">{{ lang.ratelimit.day }}</option>
+              </select>
+              <p class="text-muted mt-3">{{ lang.edit.mbox_rl_info }}</p>
+            </div>
+          </div>
+          <hr>
+          <div class="row my-2">
+            <div class="offset-sm-2 col-sm-10">
+              <select id="mbox_acitve" name="active" class="form-control">
+                <option value="1" selected>{{ lang.edit.active }}</option>
+                <option value="2">{{ lang.edit.disable_login }}</option>
+                <option value="0">{{ lang.edit.inactive }}</option>
+              </select>
+            </div>
+          </div>
+          <div class="row">
+            <div class="offset-sm-2 col-sm-10">
+              <div class="checkbox">
+                <label><input type="checkbox" value="1" name="force_pw_update"> {{ lang.edit.force_pw_update }}</label>
+                <small class="text-muted">{{ lang.edit.force_pw_update_info|format(ui_texts.main_name) }}</small>
+              </div>
             </div>
           </div>
           {% if not skip_sogo %}
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
-                <label><input type="checkbox" value="1" name="gal" checked> {{ lang.edit.gal }}</label>
-                <small class="help-block">{{ lang.edit.gal_info|raw }}</small>
+                <label><input type="checkbox" value="1" name="sogo_access"> {{ lang.edit.sogo_access }}</label>
+                <small class="text-muted">{{ lang.edit.sogo_access_info }}</small>
               </div>
             </div>
           </div>
           {% endif %}
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row my-2">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="addmailbox_template" data-api-url='add/mailbox/template' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+            </div>
+          </div>
+        </form>
+      </div>
+    </div>
+  </div>
+</div><!-- add mailbox template modal -->
+<!-- add domain modal -->
+<div class="modal fade" id="addDomainModal" tabindex="-1" role="dialog" aria-hidden="true">
+  <div class="modal-dialog modal-xl">
+    <div class="modal-content">
+      <div class="modal-header">
+        <h3 class="modal-title">{{ lang.mailbox.add_domain }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
+      </div>
+      <div class="modal-body">
+        <form class="form-horizontal" data-cached-form="true" data-id="add_domain" role="form">
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="domain">{{ lang.add.domain }}</label>
+            <div class="col-sm-10">
+              <input type="text" autocorrect="off" autocapitalize="none" class="form-control" name="domain" required>
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="description">{{ lang.add.description }}</label>
+            <div class="col-sm-10">
+              <input type="text" class="form-control" name="description">
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="description">{{ lang.mailbox.template }}</label>
+            <div class="col-sm-10">
+              <select data-live-search="true" id="domain_templates" class="form-control">
+              </select>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.add.tags }}</label>
+            <div class="col-sm-10">
+              <div class="form-control tag-box">
+                <input type="text" class="tag-input" id="addDomain_tags">
+                <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span>
+                <input type="hidden" value="" name="tags" class="tag-values" />
+              </div>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="aliases">{{ lang.add.max_aliases }}</label>
+            <div class="col-sm-10">
+              <input type="number" id="addDomain_max_aliases" class="form-control" name="aliases" value="400" required>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="mailboxes">{{ lang.add.max_mailboxes }}</label>
+            <div class="col-sm-10">
+              <input type="number" id="addDomain_max_mailboxes" class="form-control" name="mailboxes" value="10" required>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="defquota">{{ lang.add.mailbox_quota_def }}</label>
+            <div class="col-sm-10">
+              <input type="number" id="addDomain_mailbox_quota_def" class="form-control" name="defquota" value="3072" required>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="maxquota">{{ lang.add.mailbox_quota_m }}</label>
+            <div class="col-sm-10">
+              <input type="number" id="addDomain_mailbox_quota_m" class="form-control" name="maxquota" value="10240" required>
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="quota">{{ lang.add.domain_quota_m }}</label>
+            <div class="col-sm-10">
+              <input type="number" id="addDomain_domain_quota_m" class="form-control" name="quota" value="10240" required>
+            </div>
+          </div>
+          {% if not skip_sogo %}
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
-                <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
+                <label><input type="checkbox" id="addDomain_gal" value="1" name="gal" checked> {{ lang.edit.gal }}</label>
+                <small class="text-muted">{{ lang.edit.gal_info|raw }}</small>
+              </div>
+            </div>
+          </div>
+          {% endif %}
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <div class="checkbox">
+                <label><input type="checkbox" id="addDomain_active" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
           <hr>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="rl_frame">{{ lang.acl.ratelimit }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="rl_frame">{{ lang.acl.ratelimit }}</label>
             <div class="col-sm-7">
-              <input name="rl_value" type="number" class="form-control" placeholder="{{ lang.ratelimit.disabled }}">
+              <input name="rl_value" id="addDomain_rl_value" type="number" class="form-control" placeholder="{{ lang.ratelimit.disabled }}">
             </div>
             <div class="col-sm-3">
-              <select name="rl_frame" class="form-control">
+              <select name="rl_frame" id="addDomain_rl_frame" class="form-control">
               {% include 'mailbox/rl-frame.twig' %}
               </select>
             </div>
           </div>
           <hr>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="dkim_selector">{{ lang.admin.dkim_domains_selector }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="dkim_selector">{{ lang.admin.dkim_domains_selector }}</label>
             <div class="col-sm-10">
               <input class="form-control" id="dkim_selector" name="dkim_selector" value="dkim">
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="key_size">{{ lang.admin.dkim_key_length }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="key_size">{{ lang.admin.dkim_key_length }}</label>
             <div class="col-sm-10">
-              <select data-style="btn btn-default btn-sm" class="form-control" id="key_size" name="key_size">
-                <option data-subtext="bits">1024</option>
-                <option data-subtext="bits" selected>2048</option>
+              <select data-style="btn btn-secondary btn-sm" class="form-control" id="key_size" name="key_size">
+                <option data-subtext="bits" value="1024">1024</option>
+                <option data-subtext="bits" value="2048" selected>2048</option>
               </select>
             </div>
           </div>
           <hr>
-          <div class="form-group">
-            <label class="control-label col-sm-2">{{ lang.add.backup_mx_options }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.add.backup_mx_options }}</label>
             <div class="col-sm-10">
               <div class="checkbox">
-                <label><input type="checkbox" value="1" name="backupmx"> {{ lang.add.relay_domain }}</label>
+                <label><input type="checkbox" id="addDomain_relay_domain" value="1" name="backupmx"> {{ lang.add.relay_domain }}</label>
                 <br>
-                <label><input type="checkbox" value="1" name="relay_all_recipients"> {{ lang.add.relay_all }}</label>
+                <label><input type="checkbox" id="addDomain_relay_all" value="1" name="relay_all_recipients"> {{ lang.add.relay_all }}</label>
                 <p>{{ lang.add.relay_all_info|raw }}</p>
-                <label><input type="checkbox" value="1" name="relay_unknown_only"> {{ lang.add.relay_unknown_only }}</label>
+                <label><input type="checkbox" id="addDomain_relay_unknown_only" value="1" name="relay_unknown_only"> {{ lang.add.relay_unknown_only }}</label>
                 <br>
                 <p>{{ lang.add.relay_transport_info|raw }}</p>
               </div>
             </div>
           </div>
           <hr>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10 btn-group">
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10 btn-group">
               {% if not skip_sogo %}
-              <button class="btn btn-xs-lg btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{}' href="#">{{ lang.add.add_domain_only }}</button>
-              <button class="btn btn-xs-lg btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{"restart_sogo":"1"}' href="#">{{ lang.add.add_domain_restart }}</button>
+              <button class="btn btn-xs-lg btn-xs-half d-block d-sm-inline btn-secondary" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{"tags": []}' href="#">{{ lang.add.add_domain_only }}</button>
+              <button class="btn btn-xs-lg btn-xs-half d-block d-sm-inline btn-secondary" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{"restart_sogo":"1", "tags": []}' href="#">{{ lang.add.add_domain_restart }}</button>
               <div class="clearfix visible-xs"></div>
               {% else %}
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{}' href="#">{{ lang.add.add }}</button>
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{"tags": []}' href="#">{{ lang.add.add }}</button>
               {% endif %}
             </div>
           </div>
@@ -205,24 +523,156 @@
     </div>
   </div>
 </div><!-- add domain modal -->
-<!-- add resource modal -->
-<div class="modal fade" id="addResourceModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+<!-- add domain template modal -->
+<div class="modal fade" id="addDomainTemplateModal" tabindex="-1" role="dialog" aria-hidden="true">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
+        <h3 class="modal-title">{{ lang.mailbox.add_template }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
+      </div>
+      <div class="modal-body">
+        <form data-id="adddomain_template" class="form-horizontal" role="form" method="post">
+          {% if mailcow_cc_role == 'admin' %}
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="template">{{ lang.mailbox.template }}</label>
+            <div class="col-sm-10">
+              <div class="input-group mb-3">
+                <input type="text" name="template" class="form-control" aria-label="Text input with dropdown button" value="" />
+              </div>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.add.tags }}</label>
+            <div class="col-sm-10">
+              <div class="form-control tag-box">
+                <input type="text" class="tag-input">
+                <span class="btn tag-add"><i class="bi bi-plus-lg"></i></span>
+                <input type="hidden" value="" name="tags" class="tag-values" />
+              </div>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="max_num_aliases_for_domain">{{ lang.add.max_aliases }}</label>
+            <div class="col-sm-10">
+              <input type="number" class="form-control" name="max_num_aliases_for_domain" value="">
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="max_num_mboxes_for_domain">{{ lang.add.max_mailboxes }}</label>
+            <div class="col-sm-10">
+              <input type="number" class="form-control" name="max_num_mboxes_for_domain" value="">
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="def_quota_for_mbox">{{ lang.add.mailbox_quota_def }}</label>
+            <div class="col-sm-10">
+              <input type="number" class="form-control" name="def_quota_for_mbox" value="">
+            </div>
+          </div>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="max_quota_for_mbox">{{ lang.add.mailbox_quota_m }}</label>
+            <div class="col-sm-10">
+              <input type="number" class="form-control" name="max_quota_for_mbox" value="">
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="max_quota_for_domain">{{ lang.add.domain_quota_m }}</label>
+            <div class="col-sm-10">
+              <input type="number" class="form-control" name="max_quota_for_domain" value="">
+            </div>
+          </div>
+          <div class="row">
+            <div class="offset-sm-2 col-sm-10">
+              <div class="checkbox">
+                <label><input type="checkbox" value="1" name="gal" checked> {{ lang.add.gal }}</label>
+                <small class="text-muted">{{ lang.add.gal_info|raw }}</small>
+              </div>
+            </div>
+          </div>
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
+              <div class="checkbox">
+                <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
+              </div>
+            </div>
+          </div>
+          <hr>
+          <div class="row">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.edit.ratelimit }}</label>
+            <div class="col-sm-7">
+              <input name="rl_value" type="number" value="" autocomplete="off" class="form-control mb-4" placeholder="{{ lang.ratelimit.disabled }}">
+            </div>
+            <div class="col-sm-3">
+              <select name="rl_frame" class="form-control">
+                <option value="s">{{ lang.ratelimit.second }}</option>
+                <option value="m">{{ lang.ratelimit.minute }}</option>
+                <option value="h">{{ lang.ratelimit.hour }}</option>
+                <option value="d">{{ lang.ratelimit.day }}</option>
+              </select>
+            </div>
+          </div>
+          {% endif %}
+          <hr>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="dkim_selector">{{ lang.admin.dkim_domains_selector }}</label>
+            <div class="col-sm-10">
+              <input class="form-control" id="dkim_selector" name="dkim_selector" value="dkim">
+            </div>
+          </div>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="key_size">{{ lang.admin.dkim_key_length }}</label>
+            <div class="col-sm-10">
+              <select data-style="btn btn-secondary btn-sm" class="form-control" id="key_size" name="key_size">
+                <option data-subtext="bits">1024</option>
+                <option data-subtext="bits" selected>2048</option>
+              </select>
+            </div>
+          </div>
+          <hr>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end">{{ lang.edit.backup_mx_options }}</label>
+            <div class="col-sm-10">
+              <div class="checkbox">
+                <label><input type="checkbox" value="1" name="backupmx"> {{ lang.edit.relay_domain }}</label>
+                <br>
+                <label><input type="checkbox" value="1" name="relay_all_recipients"> {{ lang.edit.relay_all }}</label>
+                <p>{{ lang.edit.relay_all_info|raw }}</p>
+                <label><input type="checkbox" value="1" name="relay_unknown_only"> {{ lang.edit.relay_unknown_only }}</label>
+                <br>
+                <p>{{ lang.edit.relay_transport_info|raw }}</p>
+              </div>
+            </div>
+          </div>
+          <hr>
+          <div class="row">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="adddomain_template" data-item="{{ domain }}" data-api-url='add/domain/template' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+            </div>
+          </div>
+        </form>
+      </div>
+    </div>
+  </div>
+</div><!-- add domain template modal -->
+<!-- add resource modal -->
+<div class="modal fade" id="addResourceModal" tabindex="-1" role="dialog" aria-hidden="true">
+  <div class="modal-dialog modal-xl">
+    <div class="modal-content">
+      <div class="modal-header">
         <h3 class="modal-title">{{ lang.mailbox.add_resource }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_resource">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="description">{{ lang.add.description }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="description">{{ lang.add.description }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="description" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="domain">{{ lang.add.domain }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="domain">{{ lang.add.domain }}</label>
             <div class="col-sm-10">
               <select data-live-search="true" name="domain" title="{{ lang.add.select }}" required>
                 {% for domain in domains %}
@@ -231,8 +681,8 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="domain">{{ lang.add.kind }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="domain">{{ lang.add.kind }}</label>
             <div class="col-sm-10">
               <select name="kind" title="{{ lang.add.select }}" required>
                 <option value="location">Location</option>
@@ -241,8 +691,8 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="multiple_bookings_select">{{ lang.add.multiple_bookings }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end text-sm-end" for="multiple_bookings_select">{{ lang.add.multiple_bookings }}</label>
             <div class="col-sm-10">
               <select name="multiple_bookings_select" id="multiple_bookings_select" title="{{ lang.add.select }}" required>
                 <option value="0">{{ lang.mailbox.booking_null }}</option>
@@ -256,16 +706,16 @@
               <input type="hidden" name="multiple_bookings" id="multiple_bookings">
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_resource" data-api-url='add/resource' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_resource" data-api-url='add/resource' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -275,24 +725,24 @@
 </div><!-- add resource modal -->
 <!-- add alias modal -->
 <div class="modal fade" id="addAliasModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.mailbox.add_alias }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_alias">
           <input type="hidden" value="0" name="active">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="address">{{ lang.add.alias_address }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="address">{{ lang.add.alias_address }}</label>
             <div class="col-sm-10">
               <textarea autocorrect="off" autocapitalize="none" class="form-control" rows="5" name="address" id="address" required></textarea>
               <p>{{ lang.add.alias_address_info|raw }}</p>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="goto">{{ lang.add.target_address }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="goto">{{ lang.add.target_address }}</label>
             <div class="col-sm-10">
               <textarea id="textarea_alias_goto" autocorrect="off" autocapitalize="none" class="form-control" rows="5" id="goto" name="goto" required></textarea>
               <p>{{ lang.add.target_address_info|raw }}</p>
@@ -310,20 +760,20 @@
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="sogo_visible" checked> {{ lang.edit.sogo_visible }}</label>
               </div>
-              <p class="help-block">{{ lang.edit.sogo_visible_info }}</p>
+              <p class="text-muted">{{ lang.edit.sogo_visible_info }}</p>
               {% endif %}
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_alias" data-api-url='add/alias' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_alias" data-api-url='add/alias' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -333,24 +783,24 @@
 </div><!-- add alias modal -->
 <!-- add domain alias modal -->
 <div class="modal fade" id="addAliasDomainModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.mailbox.add_domain_alias }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_alias_domain">
           <input type="hidden" value="0" name="active">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="alias_domain">{{ lang.add.alias_domain }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="alias_domain">{{ lang.add.alias_domain }}</label>
             <div class="col-sm-10">
               <textarea autocorrect="off" autocapitalize="none" class="form-control" rows="5" name="alias_domain" id="alias_domain" required></textarea>
               <p>{{ lang.add.alias_domain_info|raw }}</p>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="target_domain">{{ lang.add.target_domain }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="target_domain">{{ lang.add.target_domain }}</label>
             <div class="col-sm-10">
               <select data-live-search="true" name="target_domain" title="{{ lang.add.select }}" required>
                 {% for domain in domains %}
@@ -359,16 +809,16 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
           <hr>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="rl_frame">{{ lang.acl.ratelimit }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="rl_frame">{{ lang.acl.ratelimit }}</label>
             <div class="col-sm-7">
               <input name="rl_value" type="number" class="form-control" placeholder="{{ lang.ratelimit.disabled }}">
             </div>
@@ -379,25 +829,25 @@
             </div>
           </div>
           <hr>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="dkim_selector2">{{ lang.admin.dkim_domains_selector }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="dkim_selector2">{{ lang.admin.dkim_domains_selector }}</label>
             <div class="col-sm-10">
               <input class="form-control" id="dkim_selector2" name="dkim_selector" value="dkim">
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="key_size2">{{ lang.admin.dkim_key_length }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="key_size2">{{ lang.admin.dkim_key_length }}</label>
             <div class="col-sm-10">
-              <select data-style="btn btn-default btn-sm" class="form-control" id="key_size2" name="key_size">
+              <select data-style="btn btn-secondary btn-sm" class="form-control" id="key_size2" name="key_size">
                 <option data-subtext="bits">1024</option>
                 <option data-subtext="bits" selected>2048</option>
               </select>
             </div>
           </div>
           <hr>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_alias_domain" data-api-url='add/alias-domain' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_alias_domain" data-api-url='add/alias-domain' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -407,52 +857,52 @@
 </div><!-- add domain alias modal -->
 <!-- add sync job modal -->
 <div class="modal fade" id="addSyncJobModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.add.syncjob }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
-        <p class="help-block">{{ lang.add.syncjob_hint }}</p>
-        <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_syncjob">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="username">{{ lang.add.username }}</label>
+        <p class="text-muted">{{ lang.add.syncjob_hint }}</p>
+        <form class="form-horizontal" data-cached-form="false" role="form" data-id="add_syncjob">
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="username">{{ lang.add.username }}</label>
             <div class="col-sm-10">
-              <select data-live-search="true" name="username" required>
+              <select data-live-search="true" name="username" title="{{ lang.add.select }}" required>
                 {% for mailbox in mailboxes %}
                   <option>{{ mailbox }}</option>
                 {% endfor %}
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="host1">{{ lang.add.hostname }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="host1">{{ lang.add.hostname }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="host1" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="port1">{{ lang.add.port }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="port1">{{ lang.add.port }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="port1" min="1" max="65535" value="143" required>
-              <small class="help-block">1-65535</small>
+              <small class="text-muted">1-65535</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="user1">{{ lang.add.username }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="user1">{{ lang.add.username }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="user1" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="password1">{{ lang.add.password }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="password1">{{ lang.add.password }}</label>
             <div class="col-sm-10">
               <input type="password" class="form-control" name="password1" required>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="enc1">{{ lang.add.enc_method }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="enc1">{{ lang.add.enc_method }}</label>
             <div class="col-sm-10">
               <select name="enc1" title="{{ lang.add.select }}" required>
                 <option value="SSL" selected>SSL</option>
@@ -461,112 +911,112 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="mins_interval">{{ lang.add.mins_interval }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="mins_interval">{{ lang.add.mins_interval }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="mins_interval" min="1" max="43800" value="20" required>
-              <small class="help-block">1-43800</small>
+              <small class="text-muted">1-43800</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="subfolder2">{{ lang.edit.subfolder2|raw }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="subfolder2">{{ lang.edit.subfolder2|raw }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="subfolder2" value="">
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="maxage">{{ lang.edit.maxage|raw }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="maxage">{{ lang.edit.maxage|raw }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="maxage" min="0" max="32000" value="0">
-              <small class="help-block">0-32000</small>
+              <small class="text-muted">0-32000</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="maxbytespersecond">{{ lang.edit.maxbytespersecond|raw }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="maxbytespersecond">{{ lang.edit.maxbytespersecond|raw }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="maxbytespersecond" min="0" max="125000000" value="0">
-              <small class="help-block">0-125000000</small>
+              <small class="text-muted">0-125000000</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="timeout1">{{ lang.edit.timeout1 }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="timeout1">{{ lang.edit.timeout1 }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="timeout1" min="1" max="32000" value="600">
-              <small class="help-block">1-32000</small>
+              <small class="text-muted">1-32000</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="timeout2">{{ lang.edit.timeout2 }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="timeout2">{{ lang.edit.timeout2 }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="timeout2" min="1" max="32000" value="600">
-              <small class="help-block">1-32000</small>
+              <small class="text-muted">1-32000</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="exclude">{{ lang.add.exclude }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="exclude">{{ lang.add.exclude }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="exclude" value="(?i)spam|(?i)junk">
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="custom_params">{{ lang.add.custom_params }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="custom_params">{{ lang.add.custom_params }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="custom_params" placeholder="--dry --some-param=xy --other-param=yx">
-              <small class="help-block">{{ lang.add.custom_params_hint }}</small>
+              <small class="text-muted">{{ lang.add.custom_params_hint }}</small>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="delete2duplicates" checked> {{ lang.add.delete2duplicates }} (--delete2duplicates)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="delete1"> {{ lang.add.delete1 }} (--delete1)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="delete2"> {{ lang.add.delete2 }} (--delete2)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="automap" checked> {{ lang.add.automap }} (--automap)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="skipcrossduplicates"> {{ lang.add.skipcrossduplicates }} (--skipcrossduplicates)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="subscribeall" checked> {{ lang.add.subscribeall }} (--subscribeall)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_syncjob" data-api-url='add/syncjob' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_syncjob" data-api-url='add/syncjob' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -576,16 +1026,16 @@
 </div><!-- add sync job modal -->
 <!-- add add_filter modal -->
 <div class="modal fade" id="addFilterModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">Filter</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_filter">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="username">{{ lang.add.username }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="username">{{ lang.add.username }}</label>
             <div class="col-sm-10">
               <select data-live-search="true" name="username" required>
                 {% for mailbox in mailboxes %}
@@ -594,8 +1044,8 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="filter_type">{{ lang.add.sieve_type }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="filter_type">{{ lang.add.sieve_type }}</label>
             <div class="col-sm-10">
               <select id="addFilterType" name="filter_type" required>
                 <option value="prefilter">Prefilter</option>
@@ -603,31 +1053,30 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="script_desc">{{ lang.add.sieve_desc }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="script_desc">{{ lang.add.sieve_desc }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" id="script_desc" name="script_desc" required maxlength="255">
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="script_data">Script:</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="script_data">Script:</label>
             <div class="col-sm-10">
               <textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control textarea-code script_data" rows="20" name="script_data" required></textarea>
+              <p class="text-muted">{{ lang.add.activate_filter_warn }}</p>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <p class="help-block">{{ lang.add.activate_filter_warn }}</p>
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10 add_filter_btns btn-group">
-              <button class="btn btn-xs-lg btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-default validate_sieve" href="#">{{ lang.add.validate }}</button>
-              <button class="btn btn-xs-lg btn-xs-half visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success add_sieve_script" data-action="add_item" data-id="add_filter" data-api-url='add/filter' data-api-attr='{}' href="#" disabled>{{ lang.admin.add }}</button>
-              <div class="clearfix visible-xs"></div>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10 add_filter_btns btn-group">
+              <button class="btn btn-xs-lg btn-xs-half d-block d-sm-inline btn-secondary validate_sieve" href="#">{{ lang.add.validate }}</button>
+              <button class="btn btn-xs-lg btn-xs-half d-block d-sm-inline btn-success add_sieve_script" data-action="add_item" data-id="add_filter" data-api-url='add/filter' data-api-attr='{}' href="#" disabled>{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -639,24 +1088,23 @@
 </div><!-- add add_filter modal -->
 <!-- add add_bcc modal -->
 <div class="modal fade" id="addBCCModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.mailbox.bcc_maps }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_bcc">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="local_dest">{{ lang.mailbox.bcc_local_dest }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="local_dest">{{ lang.mailbox.bcc_local_dest }}</label>
             <div class="col-sm-10">
               <select id="bcc-local-dest" data-live-search="true" data-size="20" name="local_dest" required>
-                <option selected>{{ lang.footer.loading }}</option>
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="type">{{ lang.mailbox.bcc_map_type }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="type">{{ lang.mailbox.bcc_map_type }}</label>
             <div class="col-sm-10">
               <select name="type" required>
                 <option value="sender">{{ lang.mailbox.bcc_sender_map }}</option>
@@ -664,23 +1112,23 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="bcc_dest">{{ lang.mailbox.bcc_destination }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="bcc_dest">{{ lang.mailbox.bcc_destination }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="bcc_dest">
               <small>{{ lang.add.bcc_dest_format|raw }}</small>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_bcc" data-api-url='add/bcc' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_bcc" data-api-url='add/bcc' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -690,38 +1138,38 @@
 </div><!-- add add_bcc modal -->
 <!-- add add_recipient_map modal -->
 <div class="modal fade" id="addRecipientMapModalAdmin" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.mailbox.recipient_maps }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_recipient_map">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="recipient_map_old">{{ lang.mailbox.recipient_map_old }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="recipient_map_old">{{ lang.mailbox.recipient_map_old }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="recipient_map_old">
               <small>{{ lang.mailbox.recipient_map_old_info }}</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="recipient_map_new">{{ lang.mailbox.recipient_map_new }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="recipient_map_new">{{ lang.mailbox.recipient_map_new }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="recipient_map_new">
               <small>{{ lang.mailbox.recipient_map_new_info }}</small>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_recipient_map" data-api-url='add/recipient_map' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_recipient_map" data-api-url='add/recipient_map' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -731,23 +1179,23 @@
 </div><!-- add add_recipient_map modal -->
 <!-- add add_tls_policy_map modal -->
 <div class="modal fade" id="addTLSPolicyMapAdmin" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.mailbox.tls_policy_maps }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_tls_policy_map">
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="dest">{{ lang.mailbox.tls_map_dest }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="dest">{{ lang.mailbox.tls_map_dest }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="dest">
               <small>{{ lang.mailbox.tls_map_dest_info }}</small>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="policy">{{ lang.mailbox.tls_map_policy }}</label>
+          <div class="row mb-2">
+            <label class="control-label col-sm-2 text-sm-end" for="policy">{{ lang.mailbox.tls_map_policy }}</label>
             <div class="col-sm-10">
               <select class="full-width-select" name="policy" required>
                 <option value="none">none</option>
@@ -761,23 +1209,23 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <label class="control-label col-sm-2" for="parameters">{{ lang.mailbox.tls_map_parameters }}</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-2 text-sm-end" for="parameters">{{ lang.mailbox.tls_map_parameters }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="parameters">
               <small>{{ lang.mailbox.tls_map_parameters_info }}</small>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_tls_policy_map" data-api-url='add/tls-policy-map' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_tls_policy_map" data-api-url='add/tls-policy-map' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -787,11 +1235,11 @@
 </div><!-- add add_tls_policy_map modal -->
 <!-- log modal -->
 <div class="modal fade" id="syncjobLogModal" tabindex="-1" role="dialog" aria-labelledby="syncjobLogModalLabel">
-  <div class="modal-dialog modal-lg" role="document">
+  <div class="modal-dialog modal-xl" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">Log</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <textarea class="form-control" rows="20" id="logText" spellcheck="false"></textarea>
@@ -801,11 +1249,11 @@
 </div><!-- log modal -->
 <!-- DNS info modal -->
 <div class="modal fade" id="dnsInfoModal" tabindex="-1" role="dialog" aria-labelledby="dnsInfoModalLabel">
-  <div class="modal-dialog modal-lg" role="document">
+  <div class="modal-dialog modal-xl" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.diagnostics.dns_records }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <p>{{ lang.diagnostics.dns_records_24hours }}</p>
diff --git a/mailcow/src/mailcow-dockerized/data/web/templates/modals/quarantine.twig b/mailcow/src/mailcow-dockerized/data/web/templates/modals/quarantine.twig
index aed4b84..3ccefa5 100644
--- a/mailcow/src/mailcow-dockerized/data/web/templates/modals/quarantine.twig
+++ b/mailcow/src/mailcow-dockerized/data/web/templates/modals/quarantine.twig
@@ -1,65 +1,65 @@
 <div class="modal fade" id="qidDetailModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title"><i class="bi bi-info-circle-fill"></i> {{ lang.quarantine.qitem }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <div id="qid_error" style="display:none" class="alert alert-danger"></div>
-        <div class="form-group">
+        <div>
           <label for="qid_detail_symbols"><h4>{{ lang.quarantine.rspamd_result }}:</h4></label>
           <p>{{ lang.quarantine.spam_score }}: <span id="qid_detail_score"></span></p>
           <hr>
           <p id="qid_detail_symbols"></p>
         </div>
-        <div class="form-group">
+        <div>
           <label for="qid_detail_subj"><h4>{{ lang.quarantine.subj }}:</h4></label>
           <p id="qid_detail_subj"></p>
         </div>
-        <div class="form-group">
+        <div>
           <label for="qid_detail_recipients"><h4>{{ lang.quarantine.recipients }}:</h4></label>
           <p id="qid_detail_recipients"></p>
         </div>
-        <div class="form-group">
+        <div>
           <label for="qid_detail_hfrom"><h4>{{ lang.quarantine.sender_header }}:</h4></label>
           <p><span class="mail-address-item" id="qid_detail_hfrom"></span></p>
         </div>
-        <div class="form-group">
+        <div>
           <label for="qid_detail_efrom"><h4>{{ lang.quarantine.sender }}:</h4></label>
           <p><span class="mail-address-item" id="qid_detail_efrom"></span></p>
         </div>
-        <div class="form-group">
+        <div>
           <label for="qid_detail_fuzzy"><h4>Fuzzy Hashes:</h4></label>
           <p id="qid_detail_fuzzy"></p>
         </div>
-        <div class="form-group" id="qTextPlain">
+        <div id="qTextPlain">
           <label for="qid_detail_text"><h4>{{ lang.quarantine.text_plain_content }}:</h4></label>
           <pre id="qid_detail_text"></pre>
         </div>
-        <div class="form-group" id="qTextHtml">
+        <div id="qTextHtml">
           <label for="qid_detail_text_from_html"><h4>{{ lang.quarantine.text_from_html_content }}:</h4></label>
           <pre id="qid_detail_text_from_html"></pre>
         </div>
         {% if acl.quarantine_attachments == 1 %}
-        <div class="form-group">
+        <div>
           <label for="qid_detail_atts"><h4>{{ lang.quarantine.atts }}:</h4></label>
           <div id="qid_detail_atts">-</div>
         </div>
         {% endif %}
         <div class="btn-group dropup" data-acl="{{ acl.quarantine }}">
-          <a class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" href="#">{{ lang.quarantine.quick_actions }} <span class="caret"></span></a>
+          <a class="btn btn-sm btn-secondary dropdown-toggle" data-bs-toggle="dropdown" href="#">{{ lang.quarantine.quick_actions }}</a>
           <ul class="dropdown-menu">
-            <li><a data-action="edit_selected" data-id="qitems_single" data-item="" data-api-url='edit/qitem' data-api-attr='{"action":"release"}' href="#">{{ lang.quarantine.deliver_inbox }}</a></li>
-            <li role="separator" class="divider"></li>
-            <li><a data-action="edit_selected" data-id="qitems_single" data-item="" data-api-url='edit/qitem' data-api-attr='{"action":"learnspam"}' href="#">{{ lang.quarantine.learn_spam_delete }}</a></li>
-            <li role="separator" class="divider"></li>
-            <li><a data-id="qitems_single" data-item="" id="quick_download_link" href="#">{{ lang.quarantine.download_eml }}</a></li>
-            <li role="separator" class="divider"></li>
-            <li><a data-id="qitems_single" data-item="" id="quick_release_link" href="#">{{ lang.quarantine.quick_release_link }}</a></li>
-            <li><a data-id="qitems_single" data-item="" id="quick_delete_link" href="#">{{ lang.quarantine.quick_delete_link }}</a></li>
-            <li role="separator" class="divider"></li>
-            <li><a data-action="delete_selected" data-id="qitems_single" data-item="" data-api-url='delete/qitem' href="#">{{ lang.quarantine.remove }}</a></li>
+            <li><a class="dropdown-item" data-action="edit_selected" data-id="qitems_single" data-item="" data-api-url='edit/qitem' data-api-attr='{"action":"release"}' href="#">{{ lang.quarantine.deliver_inbox }}</a></li>
+            <li><hr class="dropdown-divider"></li>
+            <li><a class="dropdown-item" data-action="edit_selected" data-id="qitems_single" data-item="" data-api-url='edit/qitem' data-api-attr='{"action":"learnspam"}' href="#">{{ lang.quarantine.learn_spam_delete }}</a></li>
+            <li><hr class="dropdown-divider"></li>
+            <li><a class="dropdown-item" data-id="qitems_single" data-item="" id="quick_download_link" href="#">{{ lang.quarantine.download_eml }}</a></li>
+            <li><hr class="dropdown-divider"></li>
+            <li><a class="dropdown-item" data-id="qitems_single" data-item="" id="quick_release_link" href="#">{{ lang.quarantine.quick_release_link }}</a></li>
+            <li><a class="dropdown-item" data-id="qitems_single" data-item="" id="quick_delete_link" href="#">{{ lang.quarantine.quick_delete_link }}</a></li>
+            <li><hr class="dropdown-divider"></li>
+            <li><a class="dropdown-item" data-action="delete_selected" data-id="qitems_single" data-item="" data-api-url='delete/qitem' href="#">{{ lang.quarantine.remove }}</a></li>
           </ul>
         </div>
       </div>
diff --git a/mailcow/src/mailcow-dockerized/data/web/templates/modals/queue.twig b/mailcow/src/mailcow-dockerized/data/web/templates/modals/queue.twig
new file mode 100644
index 0000000..68fe912
--- /dev/null
+++ b/mailcow/src/mailcow-dockerized/data/web/templates/modals/queue.twig
@@ -0,0 +1,14 @@
+<!-- show queue item modal -->
+<div class="modal fade" id="showQueuedMsg" tabindex="-1" role="dialog" aria-hidden="true">
+  <div class="modal-dialog modal-xl">
+    <div class="modal-content">
+      <div class="modal-header">
+        <h3 class="modal-title"><i class="bi bi-card-checklist" style="font-size:18px"></i> ID <span id="queue_id"></span></h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
+      </div>
+      <div class="modal-body">
+        <textarea class="form-control" id="queue_msg_content" name="content" rows="40"></textarea>
+      </div>
+    </div>
+  </div>
+</div><!-- show queue item modal -->
\ No newline at end of file
diff --git a/mailcow/src/mailcow-dockerized/data/web/templates/modals/user.twig b/mailcow/src/mailcow-dockerized/data/web/templates/modals/user.twig
index 97abb0a..8c96397 100644
--- a/mailcow/src/mailcow-dockerized/data/web/templates/modals/user.twig
+++ b/mailcow/src/mailcow-dockerized/data/web/templates/modals/user.twig
@@ -3,22 +3,22 @@
   <div class="modal-dialog modal-lg">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.fido2.set_fn }}</h3>
-        <p class="help-block" style="word-break:break-all" id="fido2_subject_desc" data-fido2-subject=""></p>
+        <p class="text-muted" style="word-break:break-all" id="fido2_subject_desc" data-fido2-subject=""></p>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="false" data-id="fido2ChangeFn" role="form" method="post" autocomplete="off">
           <input type="hidden" class="form-control" name="fido2_cid" id="fido2_cid">
-          <div class="form-group">
-            <label class="control-label col-sm-4" for="fido2_fn">{{ lang.fido2.fn }}:</label>
+          <div class="row mb-4">
+            <label class="control-label col-sm-4 text-end" for="fido2_fn">{{ lang.fido2.fn }}:</label>
             <div class="col-sm-8">
               <input type="text" class="form-control" name="fido2_fn">
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-4 col-sm-8">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="edit_selected" data-id="fido2ChangeFn" data-item="null" data-api-url='edit/fido2-fn' data-api-attr='{}' href="#">{{ lang.admin.save }}</button>
+          <div class="row">
+            <div class="offset-sm-4 col-sm-8">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="fido2ChangeFn" data-item="null" data-api-url='edit/fido2-fn' data-api-attr='{}' href="#">{{ lang.admin.save }}</button>
             </div>
           </div>
         </form>
@@ -28,41 +28,41 @@
 </div><!-- add domain admin modal -->
 <!-- add sync job modal -->
 <div class="modal fade" id="addSyncJobModal" tabindex="-1" role="dialog" aria-hidden="true">
-  <div class="modal-dialog modal-lg">
+  <div class="modal-dialog modal-xl">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.add.syncjob }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <p>{{ lang.add.syncjob_hint }}</p>
         <form class="form-horizontal" data-cached-form="true" role="form" data-id="add_syncjob">
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="host1">{{ lang.add.hostname }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="host1" required>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-4">
             <label class="control-label col-sm-2" for="port1">{{ lang.add.port }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="port1" min="1" max="65535" value="143" required>
-              <small class="help-block">1-65535</small>
+              <small class="text-muted">1-65535</small>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="user1">{{ lang.add.username }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="user1" required>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-4">
             <label class="control-label col-sm-2" for="password1">{{ lang.add.password }}</label>
             <div class="col-sm-10">
               <input type="password" class="form-control" name="password1" data-hibp="true" required>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="enc1">{{ lang.add.enc_method }}</label>
             <div class="col-sm-10">
               <select name="enc1" title="{{ lang.add.select }}" required>
@@ -72,111 +72,111 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="mins_interval">{{ lang.add.mins_interval }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="mins_interval" min="1" max="43800" value="20" required>
-              <small class="help-block">1-43800</small>
+              <small class="text-muted">1-43800</small>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="subfolder2">{{ lang.edit.subfolder2|raw }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="subfolder2" value="">
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="maxage">{{ lang.edit.maxage|raw }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="maxage" min="0" max="32000" value="0">
-              <small class="help-block">0-32000</small>
+              <small class="text-muted">0-32000</small>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="maxbytespersecond">{{ lang.edit.maxbytespersecond|raw }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="maxbytespersecond" min="0" max="125000000" value="0">
-              <small class="help-block">0-125000000</small>
+              <small class="text-muted">0-125000000</small>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="timeout1">{{ lang.edit.timeout1 }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="timeout1" min="1" max="32000" value="600">
-              <small class="help-block">1-32000</small>
+              <small class="text-muted">1-32000</small>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="timeout2">{{ lang.edit.timeout2 }}</label>
             <div class="col-sm-10">
               <input type="number" class="form-control" name="timeout2" min="1" max="32000" value="600">
-              <small class="help-block">1-32000</small>
+              <small class="text-muted">1-32000</small>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="exclude">{{ lang.add.exclude }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="exclude" value="(?i)spam|(?i)junk">
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-4">
             <label class="control-label col-sm-2" for="custom_params">{{ lang.add.custom_params }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="custom_params" placeholder="--delete2folders --otheroption">
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="delete2duplicates" checked> {{ lang.add.delete2duplicates }} (--delete2duplicates)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="delete1"> {{ lang.add.delete1 }} (--delete1)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="delete2"> {{ lang.add.delete2 }} (--delete2)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="automap" checked> {{ lang.add.automap }} (--automap)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="skipcrossduplicates"> {{ lang.add.skipcrossduplicates }} (--skipcrossduplicates)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="subscribeall" checked> {{ lang.add.subscribeall }} (--subscribeall)</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-4">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_syncjob" data-api-url='add/syncjob' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_syncjob" data-api-url='add/syncjob' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -189,31 +189,31 @@
   <div class="modal-dialog modal-lg">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.add.app_password }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="true" role="form" data-pwgen-length="32" data-id="add_apppasswd">
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="app_name">{{ lang.add.app_name }}</label>
             <div class="col-sm-10">
               <input type="text" class="form-control" name="app_name" required>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-4">
             <label class="control-label col-sm-2" for="app_passwd">{{ lang.user.password }} (<a href="#" class="generate_password">{{ lang.user.generate }}</a>)</label>
             <div class="col-sm-10">
               <input type="password" data-pwgen-field="true" data-hibp="true" class="form-control" name="app_passwd" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-2">
             <label class="control-label col-sm-2" for="app_passwd2">{{ lang.user.password_repeat }}</label>
             <div class="col-sm-10">
               <input type="password" data-pwgen-field="true" class="form-control" name="app_passwd2" autocomplete="new-password" required>
-              <p class="help-block">{{ lang.user.new_password_description }}</p>
+              <p class="text-muted">{{ lang.user.new_password_description }}</p>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row mb-4">
             <label class="control-label col-sm-2" for="protocols">{{ lang.add.app_passwd_protocols }}</label>
             <div class="col-sm-10">
               <select class="full-width-select" data-live-search="true" id="protocols" name="protocols" multiple>
@@ -226,16 +226,16 @@
               </select>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
               <div class="checkbox">
                 <label><input type="checkbox" value="1" name="active" checked> {{ lang.add.active }}</label>
               </div>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-2 col-sm-10">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="add_item" data-id="add_apppasswd" data-api-url='add/app-passwd' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
+          <div class="row mb-2">
+            <div class="offset-sm-2 col-sm-10">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="add_item" data-id="add_apppasswd" data-api-url='add/app-passwd' data-api-attr='{}' href="#">{{ lang.admin.add }}</button>
             </div>
           </div>
         </form>
@@ -245,11 +245,11 @@
 </div><!-- add app passwd modal -->
 <!-- log modal -->
 <div class="modal fade" id="syncjobLogModal" tabindex="-1" role="dialog" aria-labelledby="syncjobLogModalLabel">
-  <div class="modal-dialog modal-lg" role="document">
+  <div class="modal-dialog modal-xl" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">Log</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <textarea class="form-control textarea-code" rows="20" id="logText" spellcheck="false"></textarea>
@@ -259,40 +259,44 @@
 </div><!-- log modal -->
 <!-- pw change modal -->
 <div class="modal fade" id="pwChangeModal" tabindex="-1" role="dialog" aria-labelledby="pwChangeModalLabel">
-  <div class="modal-dialog" role="document">
+  <div class="modal-dialog modal-lg" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.user.change_password }}</h3>
-        {% if number_of_app_passwords > 0 %}
-        <p>{{ lang.user.change_password_hint_app_passwords | replace({'{{number_of_app_passwords}}': number_of_app_passwords}) }}</p>
-        {% endif %}
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="false" data-id="pwchange" role="form" method="post" autocomplete="off">
-          <div class="form-group">
+          <div class="row">
             <label class="control-label col-sm-3" for="user_new_pass">{{ lang.user.new_password }} (<a href="#" class="generate_password">{{ lang.user.generate }}</a>)</label>
-            <div class="col-sm-5">
+            <div class="col-sm-9">
               <input type="password" data-pwgen-field="true" data-hibp="true" class="form-control" name="user_new_pass" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row">
             <label class="control-label col-sm-3" for="user_new_pass2">{{ lang.user.new_password_repeat }}</label>
-            <div class="col-sm-5">
+            <div class="col-sm-9">
               <input type="password" data-pwgen-field="true" class="form-control" name="user_new_pass2" autocomplete="new-password" required>
-              <p class="help-block">{{ lang.user.new_password_description }}</p>
+              <p class="text-muted">{{ lang.user.new_password_description }}</p>
             </div>
           </div>
           <hr>
-          <div class="form-group">
+          <div class="row mb-4">
             <label class="control-label col-sm-3" for="user_old_pass">{{ lang.user.password_now }}</label>
-            <div class="col-sm-5">
+            <div class="col-sm-9">
               <input type="password" class="form-control" name="user_old_pass" autocomplete="off" required>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-3 col-sm-9">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="edit_selected" data-id="pwchange" data-item="null" data-api-url='edit/self' data-api-attr='{}' href="#">{{ lang.user.change_password }}</button>
+          {% if number_of_app_passwords > 0 %}
+            <div class="row mb-2">
+              <div class="offset-sm-3 col-sm-9">
+                <small>{{ lang.user.change_password_hint_app_passwords | replace({'{{number_of_app_passwords}}': number_of_app_passwords}) }}</small>
+              </div>
+            </div>
+          {% endif %}
+          <div class="row">
+            <div class="offset-sm-3 col-sm-9">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="pwchange" data-item="null" data-api-url='edit/self' data-api-attr='{}' href="#">{{ lang.user.change_password }}</button>
             </div>
           </div>
         </form>
@@ -300,49 +304,49 @@
     </div>
   </div>
 </div><!-- pw change modal -->
-<!-- pw change modal -->
+<!-- temp alias modal -->
 <div class="modal fade" id="tempAliasModal" tabindex="-1" role="dialog" aria-labelledby="tempAliasModalLabel">
-  <div class="modal-dialog" role="document">
+  <div class="modal-dialog modal-lg" role="document">
     <div class="modal-content">
       <div class="modal-body">
         <form class="form-horizontal" data-cached-form="false" data-id="pwchange" role="form" method="post" autocomplete="off">
-          <div class="form-group">
+          <div class="row">
             <label class="control-label col-sm-3" for="user_new_pass">{{ lang.user.new_password }} (<a href="#" class="generate_password">{{ lang.user.generate }}</a>)</label>
             <div class="col-sm-5">
               <input type="password" data-pwgen-field="true" data-hibp="true" class="form-control" name="user_new_pass" autocomplete="new-password" required>
             </div>
           </div>
-          <div class="form-group">
+          <div class="row">
             <label class="control-label col-sm-3" for="user_new_pass2">{{ lang.user.new_password_repeat }}</label>
             <div class="col-sm-5">
               <input type="password" data-pwgen-field="true" class="form-control" name="user_new_pass2" autocomplete="new-password" required>
-              <p class="help-block">{{ lang.user.new_password_description }}</p>
+              <p class="text-muted">{{ lang.user.new_password_description }}</p>
             </div>
           </div>
           <hr>
-          <div class="form-group">
+          <div class="row">
             <label class="control-label col-sm-3" for="user_old_pass">{{ lang.user.password_now }}</label>
             <div class="col-sm-5">
               <input type="password" class="form-control" name="user_old_pass" autocomplete="off" required>
             </div>
           </div>
-          <div class="form-group">
-            <div class="col-sm-offset-3 col-sm-9">
-              <button class="btn btn-xs-lg visible-xs-block visible-sm-inline visible-md-inline visible-lg-inline btn-success" data-action="edit_selected" data-id="pwchange" data-item="null" data-api-url='edit/self' data-api-attr='{}' href="#">{{ lang.user.change_password }}</button>
+          <div class="row">
+            <div class="offset-sm-3 col-sm-9">
+              <button class="btn btn-xs-lg d-block d-sm-inline btn-success" data-action="edit_selected" data-id="pwchange" data-item="null" data-api-url='edit/self' data-api-attr='{}' href="#">{{ lang.user.change_password }}</button>
             </div>
           </div>
         </form>
       </div>
     </div>
   </div>
-</div><!-- pw change modal -->
+</div><!-- temp alias modal -->
 <!-- sieve filter modal -->
 <div class="modal fade" id="userFilterModal" tabindex="-1" role="dialog">
-  <div class="modal-dialog" role="document">
+  <div class="modal-dialog modal-lg" role="document">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>
         <h3 class="modal-title">{{ lang.user.active_sieve }}</h3>
+        <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
       </div>
       <div class="modal-body">
         <pre id="user_sieve_filter"></pre>