git subrepo clone https://github.com/mailcow/mailcow-dockerized.git mailcow/src/mailcow-dockerized

subrepo: subdir:   "mailcow/src/mailcow-dockerized"
  merged:   "a832becb"
upstream: origin:   "https://github.com/mailcow/mailcow-dockerized.git"
  branch:   "master"
  commit:   "a832becb"
git-subrepo: version:  "0.4.3"
  origin:   "???"
  commit:   "???"
Change-Id: If5be2d621a211e164c9b6577adaa7884449f16b5
diff --git a/mailcow/src/mailcow-dockerized/data/web/modals/admin.php b/mailcow/src/mailcow-dockerized/data/web/modals/admin.php
new file mode 100644
index 0000000..e796d2e
--- /dev/null
+++ b/mailcow/src/mailcow-dockerized/data/web/modals/admin.php
@@ -0,0 +1,264 @@
+<?php

+if (!isset($_SESSION['mailcow_cc_role'])) {

+	header('Location: /');

+	exit();

+}

+?>

+<!-- 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-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>

+      </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="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="col-sm-10">

+              <textarea class="form-control" id="adminRspamdSettingsContent" name="content" rows="10"><?=$rsetting_details['content'];?></textarea>

+            </div>

+          </div>

+          <div class="form-group">

+            <div class="col-sm-offset-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-default" data-action="add_item" data-id="rsetting" data-api-url='add/rsetting' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?=$lang['admin']['add'];?></button>

+            </div>

+          </div>

+        </form>

+        <hr>

+        <p><?=$lang['admin']['rspamd-com_settings'];?></p>

+        <ul id="rspamd_presets"></ul>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="col-sm-10">

+                <input type="text" class="form-control" name="username" required>

+                &rdsh; <kbd>a-z 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="col-sm-10">

+                <select title="<?=$lang['admin']['search_domain_da'];?>" class="full-width-select" name="domains" size="5" multiple>

+                <?php

+                foreach (mailbox('get', 'domains') as $domain) {

+                  echo "<option>".htmlspecialchars($domain)."</option>";

+                }

+                ?>

+                </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="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="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="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-default" data-action="add_item" data-id="add_domain_admin" data-api-url='add/domain-admin' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?=$lang['admin']['add'];?></button>

+              </div>

+            </div>

+          </form>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="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-default" 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>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="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-default" data-action="add_item" data-id="add_oauth2_client" data-api-url='add/oauth2-client' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?=$lang['admin']['add'];?></button>

+              </div>

+            </div>

+          </form>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="col-sm-10">

+                <input type="text" class="form-control" name="username" required>

+                &rdsh; <kbd>a-z 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="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="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="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-default" data-action="add_item" data-id="add_admin" data-api-url='add/admin' data-api-attr='{}' href="#"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> <?=$lang['admin']['add'];?></button>

+              </div>

+            </div>

+          </form>

+      </div>

+    </div>

+  </div>

+</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-content">

+      <div class="modal-header">

+        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span></button>

+        <h3 class="modal-title"><span class="glyphicon glyphicon-stats"></span> Transport</h3>

+      </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="col-sm-10">

+                <input type="text" class="form-control" name="mail_from" placeholder="relay@example.org">

+              </div>

+            </div>

+            <div class="form-group">

+              <div class="col-sm-offset-2 col-sm-10">

+                <button class="btn btn-default" id="test_transport" href="#"><?=$lang['admin']['relay_run'];?></button>

+              </div>

+            </div>

+          </form>

+          <hr>

+          <div id="test_transport_result" style="font-size:10pt">-</div>

+      </div>

+    </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"><span class="glyphicon glyphicon-hourglass" style="font-size:18px"></span> 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"><span class="glyphicon glyphicon-lock"></span> Private key</h3>

+      </div>

+      <div class="modal-body">

+      <pre id="priv_key_pre"></pre>

+      </div>

+    </div>

+  </div>

+</div><!-- priv key modal -->

diff --git a/mailcow/src/mailcow-dockerized/data/web/modals/debug.php b/mailcow/src/mailcow-dockerized/data/web/modals/debug.php
new file mode 100644
index 0000000..e955a20
--- /dev/null
+++ b/mailcow/src/mailcow-dockerized/data/web/modals/debug.php
@@ -0,0 +1,6 @@
+<?php

+if (!isset($_SESSION['mailcow_cc_role'])) {

+	header('Location: /');

+	exit();

+}

+?>

diff --git a/mailcow/src/mailcow-dockerized/data/web/modals/footer.php b/mailcow/src/mailcow-dockerized/data/web/modals/footer.php
new file mode 100644
index 0000000..42d1278
--- /dev/null
+++ b/mailcow/src/mailcow-dockerized/data/web/modals/footer.php
@@ -0,0 +1,240 @@
+<?php

+if (isset($_SESSION['mailcow_cc_role']) && ($_SESSION['mailcow_cc_role'] == "admin" || $_SESSION['mailcow_cc_role'] == "domainadmin")):

+?>

+<div class="modal fade" id="YubiOTPModal" tabindex="-1" role="dialog" aria-labelledby="YubiOTPModalLabel">

+  <div class="modal-dialog" role="document">

+    <div class="modal-content">

+      <div class="modal-header"><b><?=$lang['tfa']['yubi_otp'];?></b></div>

+      <div class="modal-body">

+      <form role="form" method="post">

+        <div class="form-group">

+          <input type="text" class="form-control" name="key_id" placeholder="<?=$lang['tfa']['key_id'];?>" autocomplete="off" required>

+        </div>

+        <hr>

+        <p class="help-block"><?=sprintf($lang['tfa']['api_register'], $UI_TEXTS['main_name']);?></p>

+        <div class="form-group">

+          <input type="text" class="form-control" name="yubico_id" placeholder="Yubico API ID" autocomplete="off" required>

+        </div>

+        <div class="form-group">

+          <input type="text" class="form-control" name="yubico_key" placeholder="Yubico API Key" autocomplete="off" required>

+        </div>

+        <hr>

+        <div class="form-group">

+          <input type="password" class="form-control" name="confirm_password" placeholder="<?=$lang['user']['password_now'];?>" autocomplete="off" required>

+        </div>

+        <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="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 btn-default" 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-dialog" role="document">

+    <div class="modal-content">

+      <div class="modal-header"><b><?=$lang['tfa']['u2f'];?></b></div>

+      <div class="modal-body">

+        <form role="form" method="post" id="u2f_reg_form">

+          <div class="form-group">

+            <input type="text" class="form-control" name="key_id" placeholder="<?=$lang['tfa']['key_id'];?>" autocomplete="off" required>

+          </div>

+          <div class="form-group">

+            <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">

+            <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>

+          </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">

+          <input type="hidden" name="set_tfa"/><br/>

+        </form>

+      </div>

+    </div>

+  </div>

+</div>

+

+<div class="modal fade" id="TOTPModal" tabindex="-1" role="dialog" aria-labelledby="TOTPModalLabel">

+  <div class="modal-dialog" role="document">

+    <div class="modal-content">

+      <div class="modal-header"><b><?=$lang['tfa']['totp'];?></b></div>

+      <div class="modal-body">

+        <form role="form" method="post">

+          <div class="form-group">

+            <input type="text" class="form-control" name="key_id" placeholder="<?=$lang['tfa']['key_id_totp'];?>" autocomplete="off" required>

+          </div>

+          <div class="form-group">

+            <input type="password" class="form-control" name="confirm_password" placeholder="<?=$lang['user']['password_now'];?>" autocomplete="off" required>

+          </div>

+          <hr>

+          <?php

+          $totp_secret = $tfa->createSecret();

+          ?>

+          <input type="hidden" value="<?=$totp_secret;?>" name="totp_secret">

+          <input type="hidden" name="tfa_method" value="totp">

+          <ol>

+            <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 />

+              <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-default" type="submit" name="set_tfa"><?=$lang['tfa']['confirm'];?></button></p>

+            </li>

+          </ol>

+        </form>

+      </div>

+    </div>

+  </div>

+</div>

+

+<div class="modal fade" id="DisableTFAModal" tabindex="-1" role="dialog" aria-labelledby="DisableTFAModalLabel">

+  <div class="modal-dialog" role="document">

+    <div class="modal-content">

+      <div class="modal-header"><b><?=$lang['tfa']['delete_tfa'];?></b></div>

+      <div class="modal-body">

+        <form role="form" method="post">

+          <div class="input-group">

+            <input type="password" class="form-control" 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-danger" type="submit" name="set_tfa"><?=$lang['tfa']['delete_tfa'];?></button>

+            </span>

+          </div>

+        </form>

+      </div>

+    </div>

+  </div>

+</div>

+

+<?php

+endif;

+if (isset($_SESSION['pending_tfa_method'])):

+  $tfa_method = $_SESSION['pending_tfa_method'];

+?>

+<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">&times;</button><b><?=$lang['tfa'][$tfa_method];?></b></div>

+      <div class="modal-body">

+      <?php

+      switch ($tfa_method) {

+        case "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>

+          </div>

+          <button class="btn btn-sm btn-default" type="submit" name="verify_tfa_login"><?=$lang['login']['login'];?></button>

+        </form>

+      <?php

+        break;

+        case "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>

+          </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>

+      <?php

+        break;

+        case "totp":

+      ?>

+        <form role="form" method="post">

+          <div class="form-group">

+            <div class="input-group">

+              <span class="input-group-addon" id="tfa-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></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">

+            </div>

+          </div>

+          <button class="btn btn-sm btn-default" type="submit" name="verify_tfa_login"><?=$lang['login']['login'];?></button>

+        </form>

+        <?php

+        break;

+        case "hotp":

+      ?>

+       <div class="empty"></div>

+      <?php

+        break;

+      }

+      ?>

+      </div>

+    </div>

+  </div>

+</div>

+<?php

+endif;

+if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == 'admin'):

+?>

+<div id="RestartContainer" class="modal fade" role="dialog">

+  <div class="modal-dialog">

+    <div class="modal-content">

+    <div class="modal-header">

+      <button type="button" class="close" data-dismiss="modal">&times;</button>

+      <h4 class="modal-title"><?= $lang['footer']['restart_container']; ?> (<code id="containerName"></code>)</h4>

+    </div>

+    <div class="modal-body">

+      <p><?= $lang['footer']['restart_container_info']; ?></p>

+      <hr>

+      <button class="btn btn-md btn-primary" id="triggerRestartContainer"><?= $lang['footer']['restart_now']; ?></button>

+      <br><br>

+      <div id="statusTriggerRestartContainer"></div>

+    </div>

+    </div>

+  </div>

+</div>

+<?php

+endif;

+?>

+<div id="ConfirmDeleteModal" class="modal fade" role="dialog">

+  <div class="modal-dialog">

+    <div class="modal-content">

+    <div class="modal-header">

+      <button type="button" class="close" data-dismiss="modal">&times;</button>

+      <h4 class="modal-title"><?= $lang['footer']['confirm_delete']; ?></h4>

+    </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-danger" id="IsConfirmed"><?= $lang['footer']['delete_now']; ?></button>

+      <button class="btn btn-sm btn-default" id="isCanceled"><?= $lang['footer']['cancel']; ?></button>

+    </div>

+    </div>

+  </div>

+</div>

diff --git a/mailcow/src/mailcow-dockerized/data/web/modals/mailbox.php b/mailcow/src/mailcow-dockerized/data/web/modals/mailbox.php
new file mode 100644
index 0000000..c1362c4
--- /dev/null
+++ b/mailcow/src/mailcow-dockerized/data/web/modals/mailbox.php
@@ -0,0 +1,830 @@
+<?php

+if (!isset($_SESSION['mailcow_cc_role'])) {

+  header('Location: /');

+  exit();

+}

+?>

+<!-- 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-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>

+      </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>

+            <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="col-sm-10">

+              <select class="full-width-select" data-live-search="true" id="addSelectDomain" name="domain" required>

+              <?php

+              foreach (mailbox('get', 'domains') as $domain) {

+                echo "<option>".htmlspecialchars($domain)."</option>";

+              }

+              ?>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" 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="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="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">

+              <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>

+          <hr>

+          <div class="form-group">

+            <div class="col-sm-offset-2 col-sm-10">

+              <button class="btn btn-default" data-action="add_item" data-id="add_mailbox" data-api-url='add/mailbox' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>

+            </div>

+          </div>

+        </form>

+      </div>

+    </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">

+    <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>

+      </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>

+            <div class="col-sm-10">

+            <input type="text" autocorrect="off" autocapitalize="none" class="form-control" name="domain" required>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="description"><?=$lang['add']['description'];?></label>

+            <div class="col-sm-10">

+            <input type="text" class="form-control" name="description">

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="aliases"><?=$lang['add']['max_aliases'];?></label>

+            <div class="col-sm-10">

+            <input type="number" class="form-control" name="aliases" value="400" required>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="mailboxes"><?=$lang['add']['max_mailboxes'];?></label>

+            <div class="col-sm-10">

+            <input type="number" class="form-control" name="mailboxes" value="10" required>

+						</div>

+					</div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="defquota"><?=$lang['add']['mailbox_quota_def'];?></label>

+            <div class="col-sm-10">

+              <input type="number" class="form-control" name="defquota" value="3072" required>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="maxquota"><?=$lang['add']['mailbox_quota_m'];?></label>

+            <div class="col-sm-10">

+						<input type="number" class="form-control" name="maxquota" value="10240" required>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="quota"><?=$lang['add']['domain_quota_m'];?></label>

+            <div class="col-sm-10">

+            <input type="number" class="form-control" name="quota" value="10240" required>

+            </div>

+          </div>

+          <?php if (getenv('SKIP_SOGO') != "y") { ?>

+          <div class="form-group">

+            <div class="col-sm-offset-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'];?></small>

+              </div>

+            </div>

+          </div>

+          <?php } ?>

+          <div class="form-group">

+            <div class="col-sm-offset-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="col-sm-7">

+            <input name="rl_value" type="number" value="<?=(!empty($rl['value'])) ? $rl['value'] : null;?>" class="form-control" placeholder="disabled">

+            </div>

+            <div class="col-sm-3">

+            <select name="rl_frame" class="form-control">

+              <option value="s" <?=(isset($rl['frame']) && $rl['frame'] == 's') ? 'selected' : null;?>>msgs / second</option>

+              <option value="m" <?=(isset($rl['frame']) && $rl['frame'] == 'm') ? 'selected' : null;?>>msgs / minute</option>

+              <option value="h" <?=(isset($rl['frame']) && $rl['frame'] == 'h') ? 'selected' : null;?>>msgs / hour</option>

+              <option value="d" <?=(isset($rl['frame']) && $rl['frame'] == 'd') ? 'selected' : null;?>>msgs / day</option>

+            </select>

+            </div>

+          </div>

+          <hr>

+          <div class="form-group">

+            <label class="control-label col-sm-2"><?=$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>

+                <br>

+                <label><input type="checkbox" value="1" name="relay_all_recipients"> <?=$lang['add']['relay_all'];?></label>

+                <p><?=$lang['add']['relay_all_info'];?></p>

+                <label><input type="checkbox" value="1" name="relay_unknown_only" <?=(isset($result['relay_unknown_only']) && $result['relay_unknown_only']=="1") ? "checked" : null;?>> <?=$lang['add']['relay_unknown_only'];?></label>

+                <br>

+                <p><?=$lang['add']['relay_transport_info'];?></p>

+                <hr style="margin:25px 0px 0px 0px">

+              </div>

+            </div>

+          </div>

+          <hr>

+          <div class="form-group">

+            <div class="col-sm-offset-2 col-sm-10">

+              <?php if (getenv('SKIP_SOGO') != "y") { ?>

+              <button class="btn 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-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>

+              <?php } else { ?>

+              <button class="btn btn-default" data-action="add_item" data-id="add_domain" data-api-url='add/domain' data-api-attr='{}' href="#"><?=$lang['add']['add'];?></button>

+              <?php } ?>

+            </div>

+          </div>

+          <?php // TODO: Separate SOGo-related text

+          if (getenv('SKIP_SOGO') != "y") { ?>

+          <p><span class="glyphicon glyphicon-exclamation-sign text-danger"></span> <?=$lang['add']['post_domain_add'];?></p>

+          <?php } ?>

+        </form>

+      </div>

+    </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">

+    <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_resource'];?></h3>

+      </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="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="col-sm-10">

+              <select data-live-search="true" name="domain" title="<?=$lang['add']['select'];?>" required>

+              <?php

+              foreach (mailbox('get', 'domains') as $domain) {

+                echo "<option>".htmlspecialchars($domain)."</option>";

+              }

+              ?>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="domain"><?=$lang['add']['kind'];?></label>

+            <div class="col-sm-10">

+              <select name="kind" title="<?=$lang['add']['select'];?>" required>

+                <option value="location">Location</option>

+                <option value="group">Group</option>

+                <option value="thing">Thing</option>

+              </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="col-sm-10">

+              <select name="multiple_bookings_select" id="multiple_bookings_select" title="<?=$lang['add']['select'];?>" required>

+                <option value="0"><?=$lang['mailbox']['booking_0'];?></option>

+                <option value="-1" selected><?=$lang['mailbox']['booking_lt0'];?></option>

+                <option value="custom"><?=$lang['mailbox']['booking_custom'];?></option>

+              </select>

+              <div style="display:none" id="multiple_bookings_custom_div">

+                <hr>

+                <input type="number" class="form-control" name="multiple_bookings_custom" id="multiple_bookings_custom">

+              </div>

+              <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="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-default" data-action="add_item" data-id="add_resource" data-api-url='add/resource' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>

+            </div>

+          </div>

+        </form>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="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'];?></p>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" 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'];?></p>

+              <div class="checkbox">

+                <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_null"> <?=$lang['add']['goto_null'];?></label>

+              </div>

+              <div class="checkbox">

+                <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_spam"> <?=$lang['add']['goto_spam'];?></label>

+              </div>

+              <div class="checkbox">

+                <label><input class="goto_checkbox" type="checkbox" value="1" name="goto_ham"> <?=$lang['add']['goto_ham'];?></label>

+              </div>

+              <?php if (getenv('SKIP_SOGO') != "y") { ?>

+              <hr>

+              <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>

+              <?php } ?>

+            </div>

+          </div>

+          <div class="form-group">

+            <div class="col-sm-offset-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-default" data-action="add_item" data-id="add_alias" data-api-url='add/alias' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>

+            </div>

+          </div>

+        </form>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="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'];?></p>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" 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>

+              <?php

+              foreach (mailbox('get', 'domains') as $domain) {

+                echo "<option>".htmlspecialchars($domain)."</option>";

+              }

+              ?>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <div class="col-sm-offset-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="col-sm-7">

+            <input name="rl_value" type="number" value="<?=(!empty($rl['value'])) ? $rl['value'] : null;?>" class="form-control" placeholder="disabled">

+            </div>

+            <div class="col-sm-3">

+            <select name="rl_frame" class="form-control">

+              <option value="s" <?=(isset($rl['frame']) && $rl['frame'] == 's') ? 'selected' : null;?>>msgs / second</option>

+              <option value="m" <?=(isset($rl['frame']) && $rl['frame'] == 'm') ? 'selected' : null;?>>msgs / minute</option>

+              <option value="h" <?=(isset($rl['frame']) && $rl['frame'] == 'h') ? 'selected' : null;?>>msgs / hour</option>

+              <option value="d" <?=(isset($rl['frame']) && $rl['frame'] == 'd') ? 'selected' : null;?>>msgs / day</option>

+            </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <div class="col-sm-offset-2 col-sm-10">

+              <button class="btn btn-default" 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>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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>

+            <div class="col-sm-10">

+              <select data-live-search="true" name="username" required>

+              <?php

+              $domains = mailbox('get', 'domains');

+              if (!empty($domains)) {

+                foreach ($domains as $domain) {

+                  $mailboxes = mailbox('get', 'mailboxes', $domain);

+                  foreach ($mailboxes as $mailbox) {

+                    echo "<option>".htmlspecialchars($mailbox)."</option>";

+                  }

+                }

+              }

+              ?>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <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">

+            <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>

+            </div>

+          </div>

+          <div class="form-group">

+            <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">

+            <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" required>

+            </div>

+          </div>

+          <div class="form-group">

+            <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>

+                <option value="SSL" selected>SSL</option>

+                <option value="TLS">STARTTLS</option>

+                <option value="PLAIN">PLAIN</option>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <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>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="subfolder2"><?=$lang['edit']['subfolder2'];?></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'];?></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>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="maxbytespersecond"><?=$lang['edit']['maxbytespersecond'];?></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>

+            </div>

+          </div>

+          <div class="form-group">

+            <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>

+            </div>

+          </div>

+          <div class="form-group">

+            <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>

+            </div>

+          </div>

+          <div class="form-group">

+            <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">

+            <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="--dry --some-param=xy --other-param=yx">

+            <small class="help-block"><?=$lang['add']['custom_params_hint'];?></small>

+            </div>

+          </div>

+          <div class="form-group">

+            <div class="col-sm-offset-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="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="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="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="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="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="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-default" data-action="add_item" data-id="add_syncjob" data-api-url='add/syncjob' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>

+            </div>

+          </div>

+        </form>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="col-sm-10">

+              <select data-live-search="true" name="username" required>

+              <?php

+              $domains = mailbox('get', 'domains');

+              if (!empty($domains)) {

+                foreach ($domains as $domain) {

+                  $mailboxes = mailbox('get', 'mailboxes', $domain);

+                  foreach ($mailboxes as $mailbox) {

+                    echo "<option>".htmlspecialchars($mailbox)."</option>";

+                  }

+                }

+              }

+              ?>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" 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>

+                <option value="postfilter">Postfilter</option>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" 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="col-sm-10">

+              <textarea autocorrect="off" spellcheck="false" autocapitalize="none" class="form-control textarea-code script_data" rows="20" name="script_data" required></textarea>

+            </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="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">

+              <button class="btn btn-default validate_sieve" href="#"><?=$lang['add']['validate'];?></button>

+              <button class="btn 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>

+        <?=$lang['mailbox']['sieve_preset_header']?>

+        <ul id="sieve_presets"></ul>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="col-sm-10">

+              <select data-live-search="true" name="local_dest" required>

+              <?php

+              $domains = mailbox('get', 'domains');

+              $alias_domains = mailbox('get', 'alias_domains');

+              if (!empty($domains)) {

+                foreach ($domains as $domain) {

+                  echo "<option>".htmlspecialchars($domain)."</option>";

+                }

+              }

+              if (!empty($alias_domains)) {

+                foreach ($alias_domains as $alias_domain) {

+                  echo "<option>".htmlspecialchars($alias_domain)."</option>";

+                }

+              }

+              if (!empty($domains)) {

+                foreach ($domains as $domain) {

+                  $mailboxes = mailbox('get', 'mailboxes', $domain);

+                  foreach ($mailboxes as $mailbox) {

+                    echo "<option>".htmlspecialchars($mailbox)."</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="col-sm-10">

+              <select name="type" required>

+                <option value="sender"><?=$lang['mailbox']['bcc_sender_map'];?></option>

+                <option value="rcpt"><?=$lang['mailbox']['bcc_rcpt_map'];?></option>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" for="bcc_dest"><?=$lang['mailbox']['bcc_destination'];?></label>

+            <div class="col-sm-10">

+              <input type="text" class="form-control" name="bcc_dest">

+            </div>

+          </div>

+          <div class="form-group">

+            <div class="col-sm-offset-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-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>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="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="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="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-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>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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="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="col-sm-10">

+              <select class="full-width-select" name="policy" required>

+                <option value="none">none</option>

+                <option value="may">may</option>

+                <option value="encrypt">encrypt</option>

+                <option value="dane">dane</option>

+                <option value="dane-only">dane-only</option>

+                <option value="fingerprint">fingerprint</option>

+                <option value="verify">verify</option>

+                <option value="secure">secure</option>

+              </select>

+            </div>

+          </div>

+          <div class="form-group">

+            <label class="control-label col-sm-2" 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="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-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>

+      </div>

+    </div>

+  </div>

+</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-content">

+      <div class="modal-header"><h4 class="modal-title">Log</h4></div>

+      <div class="modal-body">

+        <textarea class="form-control" rows="20" id="logText" spellcheck="false"></textarea>

+      </div>

+    </div>

+  </div>

+</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-content">

+      <div class="modal-header"><h4 class="modal-title"><?=$lang['diagnostics']['dns_records'];?></h4></div>

+      <div class="modal-body">

+        <p><?=$lang['diagnostics']['dns_records_24hours'];?></p>

+        <div class="dns-modal-body"></div>

+      </div>

+    </div>

+  </div>

+</div><!-- DNS info modal -->

diff --git a/mailcow/src/mailcow-dockerized/data/web/modals/quarantine.php b/mailcow/src/mailcow-dockerized/data/web/modals/quarantine.php
new file mode 100644
index 0000000..3650012
--- /dev/null
+++ b/mailcow/src/mailcow-dockerized/data/web/modals/quarantine.php
@@ -0,0 +1,79 @@
+<?php

+if (!isset($_SESSION['mailcow_cc_role'])) {

+	header('Location: /');

+	exit();

+}

+?>

+<div class="modal fade" id="qidDetailModal" 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"><span class="glyphicon glyphicon-info"></span> <?=$lang['quarantine']['qitem'];?></h3>

+      </div>

+      <div class="modal-body">

+        <div id="qid_error" style="display:none" class="alert alert-danger"></div>

+        <div class="form-group">

+          <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">

+          <label for="qid_detail_subj"><h4><?=$lang['quarantine']['subj'];?>:</h4></label>

+          <p id="qid_detail_subj"></p>

+        </div>

+        <div class="form-group">

+          <label for="qid_detail_recipients"><h4><?=$lang['quarantine']['recipients'];?>:</h4></label>

+          <p id="qid_detail_recipients"></p>

+        </div>

+        <div class="form-group">

+          <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">

+          <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">

+          <label for="qid_detail_fuzzy"><h4>Fuzzy Hashes:</h4></label>

+          <p id="qid_detail_fuzzy"></p>

+        </div>

+        <div class="form-group" 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">

+          <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>

+        <?php

+        if ($_SESSION['acl']['quarantine_attachments'] == 1) {

+        ?>

+        <div class="form-group">

+          <label for="qid_detail_atts"><h4><?=$lang['quarantine']['atts'];?>:</h4></label>

+          <div id="qid_detail_atts">-</div>

+        </div>

+        <?php

+        }

+        ?>

+        <div class="btn-group dropup" data-acl="<?=$_SESSION['acl']['quarantine'];?>">

+          <a class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" href="#"><?=$lang['quarantine']['quick_actions'];?> <span class="caret"></span></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>

+          </ul>

+        </div>

+      </div>

+    </div>

+  </div>

+</div>

+

diff --git a/mailcow/src/mailcow-dockerized/data/web/modals/user.php b/mailcow/src/mailcow-dockerized/data/web/modals/user.php
new file mode 100644
index 0000000..4d15556
--- /dev/null
+++ b/mailcow/src/mailcow-dockerized/data/web/modals/user.php
@@ -0,0 +1,299 @@
+<?php

+if (!isset($_SESSION['mailcow_cc_role'])) {

+	header('Location: /');

+	exit();

+}

+?>

+<!-- 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-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>

+      </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="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-default" 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>

+      </div>

+    </div>

+  </div>

+</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-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>

+      </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">

+						<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">

+						<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>

+						</div>

+					</div>

+					<div class="form-group">

+						<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">

+						<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">

+						<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>

+                <option value="SSL" selected>SSL</option>

+                <option value="TLS">STARTTLS</option>

+                <option value="PLAIN">PLAIN</option>

+							</select>

+						</div>

+					</div>

+					<div class="form-group">

+						<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>

+						</div>

+					</div>

+					<div class="form-group">

+						<label class="control-label col-sm-2" for="subfolder2"><?=$lang['edit']['subfolder2'];?></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'];?></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>

+						</div>

+					</div>

+					<div class="form-group">

+						<label class="control-label col-sm-2" for="maxbytespersecond"><?=$lang['edit']['maxbytespersecond'];?></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>

+						</div>

+					</div>

+					<div class="form-group">

+						<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>

+						</div>

+					</div>

+          <div class="form-group">

+						<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>

+						</div>

+					</div>

+					<div class="form-group">

+						<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">

+						<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="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="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="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="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="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="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="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-default" data-action="add_item" data-id="add_syncjob" data-api-url='add/syncjob' data-api-attr='{}' href="#"><?=$lang['admin']['add'];?></button>

+						</div>

+					</div>

+				</form>

+      </div>

+    </div>

+  </div>

+</div><!-- add sync job modal -->

+<!-- app passwd modal -->

+<div class="modal fade" id="addAppPasswdModal" 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"><?=$lang['add']['app_password'];?></h3>

+      </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">

+						<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">

+            <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">

+            <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>

+            </div>

+          </div>

+					<div class="form-group">

+						<div class="col-sm-offset-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-default" 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>

+      </div>

+    </div>

+  </div>

+</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-content">

+      <div class="modal-header"><h4 class="modal-title">Log</h4></div>

+      <div class="modal-body">

+        <textarea class="form-control textarea-code" rows="20" id="logText" spellcheck="false"></textarea>

+      </div>

+    </div>

+  </div>

+</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-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">

+            <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">

+            <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>

+            </div>

+          </div>

+          <hr>

+          <div class="form-group">

+            <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-default" 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 -->

+<!-- sieve filter modal -->

+<div class="modal fade" id="userFilterModal" tabindex="-1" role="dialog">

+  <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['user']['active_sieve'];?></h3>

+      </div>

+      <div class="modal-body">

+      <pre id="user_sieve_filter"></pre>

+      </div>

+    </div>

+  </div>

+</div><!-- sieve filter modal -->