Skip to content

Commit

Permalink
Merge branch 'mailcow:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
vahidirp authored Aug 21, 2024
2 parents ce4c61a + 8971b11 commit b0547e2
Show file tree
Hide file tree
Showing 17 changed files with 182 additions and 178 deletions.
2 changes: 1 addition & 1 deletion data/Dockerfiles/acme/acme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fi
chmod 600 ${ACME_BASE}/key.pem

log_f "Waiting for database..."
while ! mysqladmin status --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent > /dev/null; do
while ! /usr/bin/mariadb-admin status --ssl=false --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent > /dev/null; do
sleep 2
done
log_f "Database OK"
Expand Down
2 changes: 1 addition & 1 deletion data/Dockerfiles/dockerapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ COPY main.py /app/main.py
COPY modules/ /app/modules/

ENTRYPOINT ["/bin/sh", "/app/docker-entrypoint.sh"]
CMD exec python main.py
CMD ["python", "main.py"]
2 changes: 1 addition & 1 deletion data/Dockerfiles/dovecot/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

# Wait for MySQL to warm-up
while ! mysqladmin status --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
while ! mariadb-admin status --ssl=false --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
echo "Waiting for database to come up..."
sleep 2
done
Expand Down
12 changes: 8 additions & 4 deletions data/Dockerfiles/dovecot/sa-rules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ else
fi

# Deploy
curl --connect-timeout 15 --retry 10 --max-time 30 https://www.spamassassin.heinlein-support.de/$(dig txt 1.4.3.spamassassin.heinlein-support.de +short | tr -d '"' | tr -dc '0-9').tar.gz --output /tmp/sa-rules-heinlein.tar.gz
if gzip -t /tmp/sa-rules-heinlein.tar.gz; then
tar xfvz /tmp/sa-rules-heinlein.tar.gz -C /tmp/sa-rules-heinlein
cat /tmp/sa-rules-heinlein/*cf > /etc/rspamd/custom/sa-rules
if curl --connect-timeout 15 --retry 10 --max-time 30 https://www.spamassassin.heinlein-support.de/$(dig txt 1.4.3.spamassassin.heinlein-support.de +short | tr -d '"' | tr -dc '0-9').tar.gz --output /tmp/sa-rules-heinlein.tar.gz; then
if gzip -t /tmp/sa-rules-heinlein.tar.gz; then
tar xfvz /tmp/sa-rules-heinlein.tar.gz -C /tmp/sa-rules-heinlein
cat /tmp/sa-rules-heinlein/*cf > /etc/rspamd/custom/sa-rules
fi
else
echo "Failed to download SA rules. Exiting."
exit 0 # Must be 0 otherwise dovecot would not start at all
fi

sed -i -e 's/\([^\\]\)\$\([^\/]\)/\1\\$\2/g' /etc/rspamd/custom/sa-rules
Expand Down
4 changes: 2 additions & 2 deletions data/Dockerfiles/phpfpm/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function array_by_comma { local IFS=","; echo "$*"; }

# Wait for containers
while ! mysqladmin status --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
while ! mariadb-admin status --ssl=false --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
echo "Waiting for SQL..."
sleep 2
done
Expand Down Expand Up @@ -44,7 +44,7 @@ until [[ ${SQL_UPGRADE_STATUS} == 'success' ]]; do
echo "MySQL applied an upgrade, debug output:"
echo ${SQL_FULL_UPGRADE_RETURN}
sleep 3
while ! mysqladmin status --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
while ! mariadb-admin status --ssl=false --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
echo "Waiting for SQL to return, please wait"
sleep 2
done
Expand Down
2 changes: 1 addition & 1 deletion data/Dockerfiles/postfix/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ EXPOSE 588

ENTRYPOINT ["/docker-entrypoint.sh"]

CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
2 changes: 1 addition & 1 deletion data/Dockerfiles/postfix/postfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ trap "postfix stop" EXIT
[[ ! -d /opt/postfix/conf/sql/ ]] && mkdir -p /opt/postfix/conf/sql/

# Wait for MySQL to warm-up
while ! mysqladmin status --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
while ! mariadb-admin status --ssl=false --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
echo "Waiting for database to come up..."
sleep 2
done
Expand Down
2 changes: 1 addition & 1 deletion data/Dockerfiles/sogo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ RUN chmod +x /bootstrap-sogo.sh \

ENTRYPOINT ["/docker-entrypoint.sh"]

CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
2 changes: 1 addition & 1 deletion data/Dockerfiles/sogo/bootstrap-sogo.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Wait for MySQL to warm-up
while ! mysqladmin status --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
while ! mariadb-admin status --ssl=false --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
echo "Waiting for database to come up..."
sleep 2
done
Expand Down
2 changes: 1 addition & 1 deletion data/Dockerfiles/unbound/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ HEALTHCHECK --interval=30s --timeout=10s \
CMD sh -c '[ -f /tmp/healthcheck_status ] && [ "$(cat /tmp/healthcheck_status)" -eq 0 ] || exit 1'

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
2 changes: 1 addition & 1 deletion data/Dockerfiles/watchdog/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ RUN apk add --update \
COPY watchdog.sh /watchdog.sh
COPY check_mysql_slavestatus.sh /usr/lib/nagios/plugins/check_mysql_slavestatus.sh

CMD /watchdog.sh
CMD ["/watchdog.sh"]
2 changes: 1 addition & 1 deletion data/Dockerfiles/watchdog/watchdog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if [[ ! -p /tmp/com_pipe ]]; then
fi

# Wait for containers
while ! mysqladmin status --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
while ! mariadb-admin status --ssl=false --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} --silent; do
echo "Waiting for SQL..."
sleep 2
done
Expand Down
2 changes: 1 addition & 1 deletion data/conf/rspamd/meta_exporter/pipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function getallheaders() {

$qid = $headers['X-Rspamd-Qid'];
$fuzzy = $headers['X-Rspamd-Fuzzy'];
$subject = $headers['X-Rspamd-Subject'];
$subject = iconv_mime_decode($headers['X-Rspamd-Subject']);
$score = $headers['X-Rspamd-Score'];
$rcpts = $headers['X-Rspamd-Rcpt'];
$user = $headers['X-Rspamd-User'];
Expand Down
2 changes: 1 addition & 1 deletion data/conf/rspamd/meta_exporter/pushover.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function getallheaders() {
$rcpts = $headers['X-Rspamd-Rcpt'];
$sender = $headers['X-Rspamd-From'];
$ip = $headers['X-Rspamd-Ip'];
$subject = $headers['X-Rspamd-Subject'];
$subject = iconv_mime_decode($headers['X-Rspamd-Subject']);
$messageid= $json_body->message_id;
$priority = 0;

Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ services:
- rspamd

php-fpm-mailcow:
image: mailcow/phpfpm:1.88
image: mailcow/phpfpm:1.89
command: "php-fpm -d date.timezone=${TZ} -d expose_php=0"
depends_on:
- redis-mailcow
Expand Down Expand Up @@ -176,7 +176,7 @@ services:
- phpfpm

sogo-mailcow:
image: mailcow/sogo:1.124
image: mailcow/sogo:1.125
environment:
- DBNAME=${DBNAME}
- DBUSER=${DBUSER}
Expand Down Expand Up @@ -223,7 +223,7 @@ services:
- sogo

dovecot-mailcow:
image: mailcow/dovecot:2.0
image: mailcow/dovecot:2.1
depends_on:
- mysql-mailcow
- netfilter-mailcow
Expand Down Expand Up @@ -307,7 +307,7 @@ services:
- dovecot

postfix-mailcow:
image: mailcow/postfix:1.75
image: mailcow/postfix:1.76
depends_on:
mysql-mailcow:
condition: service_started
Expand Down Expand Up @@ -407,7 +407,7 @@ services:
condition: service_started
unbound-mailcow:
condition: service_healthy
image: mailcow/acme:1.89
image: mailcow/acme:1.90
dns:
- ${IPV4_NETWORK:-172.22.1}.254
environment:
Expand Down Expand Up @@ -463,7 +463,7 @@ services:
- /lib/modules:/lib/modules:ro

watchdog-mailcow:
image: mailcow/watchdog:2.04
image: mailcow/watchdog:2.05
dns:
- ${IPV4_NETWORK:-172.22.1}.254
tmpfs:
Expand Down
14 changes: 7 additions & 7 deletions generate_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [[ "$(uname -r)" =~ ^4\.15\.0-60 ]]; then
fi

if [[ "$(uname -r)" =~ ^4\.4\. ]]; then
if grep -q Ubuntu <<< $(uname -a); then
if grep -q Ubuntu <<< "$(uname -a)"; then
echo "DO NOT RUN mailcow ON THIS UBUNTU KERNEL!";
echo "Please update to linux-generic-hwe-16.04 by running \"apt-get install --install-recommends linux-generic-hwe-16.04\""
exit 1
Expand Down Expand Up @@ -41,7 +41,7 @@ if docker compose > /dev/null 2>&1; then
echo -e "\e[33mFound Docker Compose Plugin (native).\e[0m"
echo -e "\e[33mSetting the DOCKER_COMPOSE_VERSION Variable to native\e[0m"
sleep 2
echo -e "\e[33mNotice: You´ll have to update this Compose Version via your Package Manager manually!\e[0m"
echo -e "\e[33mNotice: You'll have to update this Compose Version via your Package Manager manually!\e[0m"
else
echo -e "\e[31mCannot find Docker Compose with a Version Higher than 2.X.X.\e[0m"
echo -e "\e[31mPlease update/install it manually regarding to this doc site: https://docs.mailcow.email/install/\e[0m"
Expand Down Expand Up @@ -158,7 +158,7 @@ done
MEM_TOTAL=$(awk '/MemTotal/ {print $2}' /proc/meminfo)

if [ -z "${SKIP_CLAMD}" ]; then
if [ ${MEM_TOTAL} -le "2621440" ]; then
if [ "${MEM_TOTAL}" -le "2621440" ]; then
echo "Installed memory is <= 2.5 GiB. It is recommended to disable ClamAV to prevent out-of-memory situations."
echo "ClamAV can be re-enabled by setting SKIP_CLAMD=n in mailcow.conf."
read -r -p "Do you want to disable ClamAV now? [Y/n] " response
Expand All @@ -176,10 +176,10 @@ if [ -z "${SKIP_CLAMD}" ]; then
fi

if [ -z "${SKIP_SOLR}" ]; then
if [ ${MEM_TOTAL} -le "2097152" ]; then
if [ "${MEM_TOTAL}" -le "2097152" ]; then
echo "Disabling Solr on low-memory system."
SKIP_SOLR=y
elif [ ${MEM_TOTAL} -le "3670016" ]; then
elif [ "${MEM_TOTAL}" -le "3670016" ]; then
echo "Installed memory is <= 3.5 GiB. It is recommended to disable Solr to prevent out-of-memory situations."
echo "Solr is a prone to run OOM and should be monitored. The default Solr heap size is 1024 MiB and should be set in mailcow.conf according to your expected load."
echo "Solr can be re-enabled by setting SKIP_SOLR=n in mailcow.conf but will refuse to start with less than 2 GB total memory."
Expand All @@ -206,7 +206,7 @@ if [[ ${SKIP_BRANCH} != y ]]; then
sleep 1

while [ -z "${MAILCOW_BRANCH}" ]; do
read -r -p "Choose the Branch with it´s number [1/2] " branch
read -r -p "Choose the Branch with it's number [1/2] " branch
case $branch in
[2])
MAILCOW_BRANCH="nightly"
Expand All @@ -218,7 +218,7 @@ if [[ ${SKIP_BRANCH} != y ]]; then
done

git fetch --all
git checkout -f $MAILCOW_BRANCH
git checkout -f "$MAILCOW_BRANCH"

elif [[ ${SKIP_BRANCH} == y ]]; then
echo -e "\033[33mEnabled Dev Mode.\033[0m"
Expand Down
Loading

0 comments on commit b0547e2

Please sign in to comment.