git subrepo commit (merge) mailcow/src/mailcow-dockerized

subrepo: subdir:   "mailcow/src/mailcow-dockerized"
  merged:   "32243e56"
upstream: origin:   "https://github.com/mailcow/mailcow-dockerized.git"
  branch:   "master"
  commit:   "e2b4b6f6"
git-subrepo: version:  "0.4.3"
  origin:   "???"
  commit:   "???"
Change-Id: I51e2016ef5ab88a8b0bdc08551b18f48ceef0aa5
diff --git a/mailcow/src/mailcow-dockerized/data/web/inc/functions.mailbox.inc.php b/mailcow/src/mailcow-dockerized/data/web/inc/functions.mailbox.inc.php
index 24e5dab..21b6b13 100644
--- a/mailcow/src/mailcow-dockerized/data/web/inc/functions.mailbox.inc.php
+++ b/mailcow/src/mailcow-dockerized/data/web/inc/functions.mailbox.inc.php
@@ -579,6 +579,9 @@
           if (!empty(intval($_data['rl_value']))) {

             ratelimit('edit', 'domain', array('rl_value' => $_data['rl_value'], 'rl_frame' => $_data['rl_frame'], 'object' => $domain));

           }

+          if (!empty($_data['key_size']) && !empty($_data['dkim_selector'])) {

+            dkim('add', array('key_size' => $_data['key_size'], 'dkim_selector' => $_data['dkim_selector'], 'domains' => $domain));

+          }

           if (!empty($restart_sogo)) {

             $restart_response = json_decode(docker('post', 'sogo-mailcow', 'restart'), true);

             if ($restart_response['type'] == "success") {

@@ -906,6 +909,9 @@
             if (!empty(intval($_data['rl_value']))) {

               ratelimit('edit', 'domain', array('rl_value' => $_data['rl_value'], 'rl_frame' => $_data['rl_frame'], 'object' => $alias_domain));

             }

+            if (!empty($_data['key_size']) && !empty($_data['dkim_selector'])) {

+              dkim('add', array('key_size' => $_data['key_size'], 'dkim_selector' => $_data['dkim_selector'], 'domains' => $alias_domain));

+            }

             $_SESSION['return'][] = array(

               'type' => 'success',

               'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),

@@ -956,6 +962,7 @@
           $imap_access = (isset($_data['imap_access'])) ? intval($_data['imap_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['imap_access']);

           $pop3_access = (isset($_data['pop3_access'])) ? intval($_data['pop3_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['pop3_access']);

           $smtp_access = (isset($_data['smtp_access'])) ? intval($_data['smtp_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['smtp_access']);

+          $sieve_access = (isset($_data['sieve_access'])) ? intval($_data['sieve_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['sieve_access']);

           $relayhost = (isset($_data['relayhost'])) ? intval($_data['relayhost']) : 0;

           $quarantine_notification = (isset($_data['quarantine_notification'])) ? strval($_data['quarantine_notification']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification']);

           $quarantine_category = (isset($_data['quarantine_category'])) ? strval($_data['quarantine_category']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_category']);

@@ -969,6 +976,7 @@
               'imap_access' => strval($imap_access),

               'pop3_access' => strval($pop3_access),

               'smtp_access' => strval($smtp_access),

+              'sieve_access' => strval($sieve_access),

               'relayhost' => strval($relayhost),

               'passwd_update' => time(),

               'mailbox_format' => strval($MAILBOX_DEFAULT_ATTRIBUTES['mailbox_format']),

@@ -1673,6 +1681,7 @@
               $user1 = (!empty($_data['user1'])) ? $_data['user1'] : $is_now['user1'];

               $active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active'];

               $last_run = (isset($_data['last_run'])) ? NULL : $is_now['last_run'];

+              $success = (isset($_data['success'])) ? NULL : $is_now['success'];

               $delete2duplicates = (isset($_data['delete2duplicates'])) ? intval($_data['delete2duplicates']) : $is_now['delete2duplicates'];

               $subscribeall = (isset($_data['subscribeall'])) ? intval($_data['subscribeall']) : $is_now['subscribeall'];

               $delete1 = (isset($_data['delete1'])) ? intval($_data['delete1']) : $is_now['delete1'];

@@ -1768,6 +1777,7 @@
               `exclude` = :exclude,

               `host1` = :host1,

               `last_run` = :last_run,

+              `success` = :success,

               `user1` = :user1,

               `password1` = :password1,

               `mins_interval` = :mins_interval,

@@ -1794,6 +1804,7 @@
               ':user1' => $user1,

               ':password1' => $password1,

               ':last_run' => $last_run,

+              ':success' => $success,

               ':mins_interval' => $mins_interval,

               ':port1' => $port1,

               ':enc1' => $enc1,

@@ -2328,17 +2339,20 @@
             }

             $is_now = mailbox('get', 'mailbox_details', $username);

             if (isset($_data['protocol_access'])) {

+              $_data['protocol_access'] = (array)$_data['protocol_access'];

               $_data['imap_access'] = (in_array('imap', $_data['protocol_access'])) ? 1 : 0;

               $_data['pop3_access'] = (in_array('pop3', $_data['protocol_access'])) ? 1 : 0;

               $_data['smtp_access'] = (in_array('smtp', $_data['protocol_access'])) ? 1 : 0;

+              $_data['sieve_access'] = (in_array('sieve', $_data['protocol_access'])) ? 1 : 0;

             }

             if (!empty($is_now)) {

               $active     = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active'];

               (int)$force_pw_update = (isset($_data['force_pw_update'])) ? intval($_data['force_pw_update']) : intval($is_now['attributes']['force_pw_update']);

-              (int)$sogo_access = (isset($_data['sogo_access']) && isset($_SESSION['acl']['protocol_access']) && $_SESSION['acl']['protocol_access'] == "1") ? intval($_data['sogo_access']) : intval($is_now['attributes']['sogo_access']);

+              (int)$sogo_access = (isset($_data['sogo_access']) && isset($_SESSION['acl']['sogo_access']) && $_SESSION['acl']['sogo_access'] == "1") ? intval($_data['sogo_access']) : intval($is_now['attributes']['sogo_access']);

               (int)$imap_access = (isset($_data['imap_access']) && isset($_SESSION['acl']['protocol_access']) && $_SESSION['acl']['protocol_access'] == "1") ? intval($_data['imap_access']) : intval($is_now['attributes']['imap_access']);

               (int)$pop3_access = (isset($_data['pop3_access']) && isset($_SESSION['acl']['protocol_access']) && $_SESSION['acl']['protocol_access'] == "1") ? intval($_data['pop3_access']) : intval($is_now['attributes']['pop3_access']);

               (int)$smtp_access = (isset($_data['smtp_access']) && isset($_SESSION['acl']['protocol_access']) && $_SESSION['acl']['protocol_access'] == "1") ? intval($_data['smtp_access']) : intval($is_now['attributes']['smtp_access']);

+              (int)$sieve_access = (isset($_data['sieve_access']) && isset($_SESSION['acl']['protocol_access']) && $_SESSION['acl']['protocol_access'] == "1") ? intval($_data['sieve_access']) : intval($is_now['attributes']['sieve_access']);

               (int)$relayhost = (isset($_data['relayhost']) && isset($_SESSION['acl']['mailbox_relayhost']) && $_SESSION['acl']['mailbox_relayhost'] == "1") ? intval($_data['relayhost']) : intval($is_now['attributes']['relayhost']);

               (int)$quota_m = (isset_has_content($_data['quota'])) ? intval($_data['quota']) : ($is_now['quota'] / 1048576);

               $name       = (!empty($_data['name'])) ? ltrim(rtrim($_data['name'], '>'), '<') : $is_now['name'];

@@ -2604,6 +2618,7 @@
                 `attributes` = JSON_SET(`attributes`, '$.force_pw_update', :force_pw_update),

                 `attributes` = JSON_SET(`attributes`, '$.sogo_access', :sogo_access),

                 `attributes` = JSON_SET(`attributes`, '$.imap_access', :imap_access),

+                `attributes` = JSON_SET(`attributes`, '$.sieve_access', :sieve_access),

                 `attributes` = JSON_SET(`attributes`, '$.pop3_access', :pop3_access),

                 `attributes` = JSON_SET(`attributes`, '$.relayhost', :relayhost),

                 `attributes` = JSON_SET(`attributes`, '$.smtp_access', :smtp_access)

@@ -2616,6 +2631,7 @@
               ':sogo_access' => $sogo_access,

               ':imap_access' => $imap_access,

               ':pop3_access' => $pop3_access,

+              ':sieve_access' => $sieve_access,

               ':smtp_access' => $smtp_access,

               ':relayhost' => $relayhost,

               ':username' => $username