[Dockerapi] add pubsub handler for broadcasting in ha setup

This commit is contained in:
FreddleSpl0it
2023-06-12 16:37:48 +02:00
parent 67510adb9e
commit 06cce79806
8 changed files with 764 additions and 560 deletions

View File

@@ -4930,14 +4930,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
if (!empty($mailbox_details['domain']) && !empty($mailbox_details['local_part'])) {
$maildir = $mailbox_details['domain'] . '/' . $mailbox_details['local_part'];
$exec_fields = array('cmd' => 'maildir', 'task' => 'cleanup', 'maildir' => $maildir);
$maildir_gc = json_decode(docker('post', 'dovecot-mailcow', 'exec', $exec_fields), true);
if ($maildir_gc['type'] != 'success') {
$_SESSION['return'][] = array(
'type' => 'warning',
'log' => array(__FUNCTION__, $_action, $_type, $_data_log, $_attr),
'msg' => 'Could not move maildir to garbage collector: ' . $maildir_gc['msg']
);
}
docker('broadcast', 'dovecot-mailcow', 'exec', $exec_fields);
}
else {
$_SESSION['return'][] = array(