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

subrepo: subdir:   "mailcow/src/mailcow-dockerized"
  merged:   "02ae5285"
upstream: origin:   "https://github.com/mailcow/mailcow-dockerized.git"
  branch:   "master"
  commit:   "649a5c01"
git-subrepo: version:  "0.4.3"
  origin:   "???"
  commit:   "???"
Change-Id: I870ad468fba026cc5abf3c5699ed1e12ff28b32b
diff --git a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/Dockerfile b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/Dockerfile
index 1e49965..9cf5f62 100644
--- a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/Dockerfile
+++ b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/Dockerfile
@@ -4,14 +4,13 @@
 ARG DEBIAN_FRONTEND=noninteractive
 ARG SOGO_DEBIAN_REPOSITORY=http://packages.inverse.ca/SOGo/nightly/5/debian/
 ENV LC_ALL C
-ENV GOSU_VERSION 1.11
+ENV GOSU_VERSION 1.12
 
 # Prerequisites
 RUN echo "Building from repository $SOGO_DEBIAN_REPOSITORY" \
   && apt-get update && apt-get install -y --no-install-recommends \
   apt-transport-https \
   ca-certificates \
-  cron \
   gettext \
   gnupg \
   mariadb-client \
diff --git a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/bootstrap-sogo.sh b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/bootstrap-sogo.sh
index fef7958..04472df 100755
--- a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/bootstrap-sogo.sh
+++ b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/bootstrap-sogo.sh
@@ -128,11 +128,6 @@
   done
 fi
 
-if [[ "${ALLOW_ADMIN_EMAIL_LOGIN}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
-  TRUST_PROXY="YES"
-else
-  TRUST_PROXY="NO"
-fi
 # cat /dev/urandom seems to hang here occasionally and is not recommended anyway, better use openssl
 RAND_PASS=$(openssl rand -base64 16 | tr -dc _A-Z-a-z-0-9)
 
@@ -148,7 +143,7 @@
     <key>SOGoIMAPServer</key>
     <string>imap://${IPV4_NETWORK}.250:143/?TLS=YES&amp;tlsVerifyMode=none</string>
     <key>SOGoTrustProxyAuthentication</key>
-    <string>${TRUST_PROXY}</string>
+    <string>YES</string>
     <key>SOGoEncryptionKey</key>
     <string>${RAND_PASS}</string>
     <key>OCSCacheFolderURL</key>
@@ -249,14 +244,4 @@
 # Chown backup path
 chown -R sogo:sogo /sogo_backup
 
-# Creating cronjobs
-if [[ "${MASTER}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
-  echo "* * * * *   sogo   /usr/sbin/sogo-ealarms-notify -p /etc/sogo/sieve.creds 2>/dev/null" > /etc/cron.d/sogo
-  echo "* * * * *   sogo   /usr/sbin/sogo-tool expire-sessions ${SOGO_EXPIRE_SESSION}" >> /etc/cron.d/sogo
-  echo "0 0 * * *   sogo   /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.creds" >> /etc/cron.d/sogo
-  echo "0 2 * * *   sogo   /usr/sbin/sogo-tool backup /sogo_backup ALL" >> /etc/cron.d/sogo
-else
-  rm /etc/cron.d/sogo
-fi
-
 exec gosu sogo /usr/sbin/sogod
diff --git a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/docker-entrypoint.sh b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/docker-entrypoint.sh
index ce28c34..2ff602a 100755
--- a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/docker-entrypoint.sh
+++ b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/docker-entrypoint.sh
@@ -10,4 +10,12 @@
   cp /etc/syslog-ng/syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng.conf
 fi
 
+# Run hooks
+for file in /hooks/*; do
+  if [ -x "${file}" ]; then
+    echo "Running hook ${file}"
+    "${file}"
+  fi
+done
+
 exec "$@"
diff --git a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/supervisord.conf b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/supervisord.conf
index 551a8e1..4946d98 100644
--- a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/supervisord.conf
+++ b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/supervisord.conf
@@ -11,18 +11,13 @@
 autostart=true
 priority=1
 
-[program:cron]
-command=/usr/sbin/cron -f
-autorestart=true
-priority=2
-
 [program:bootstrap-sogo]
 command=/bootstrap-sogo.sh
 stdout_logfile=/dev/stdout
 stdout_logfile_maxbytes=0
 stderr_logfile=/dev/stderr
 stderr_logfile_maxbytes=0
-priority=3
+priority=2
 startretries=10
 autorestart=true
 stopwaitsecs=120
diff --git a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/syslog-ng-redis_slave.conf b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/syslog-ng-redis_slave.conf
index 9b04c78..5a84b72 100644
--- a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/syslog-ng-redis_slave.conf
+++ b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/syslog-ng-redis_slave.conf
@@ -30,7 +30,7 @@
     host("`REDIS_SLAVEOF_IP`")
     persist-name("redis2")
     port(`REDIS_SLAVEOF_PORT`)
-    command("PUBLISH" "F2B_CHANNEL" "$MESSAGE")
+    command("PUBLISH" "F2B_CHANNEL" "$(sanitize $MESSAGE)")
   );
 };
 log {
diff --git a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/syslog-ng.conf b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/syslog-ng.conf
index 0c257d6..537038e 100644
--- a/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/syslog-ng.conf
+++ b/mailcow/src/mailcow-dockerized/data/Dockerfiles/sogo/syslog-ng.conf
@@ -30,7 +30,7 @@
     host("redis-mailcow")
     persist-name("redis2")
     port(6379)
-    command("PUBLISH" "F2B_CHANNEL" "$MESSAGE")
+    command("PUBLISH" "F2B_CHANNEL" "$(sanitize $MESSAGE)")
   );
 };
 log {