From d436977dcfa7358e90f87d7865fcb210c8b40afc Mon Sep 17 00:00:00 2001 From: kamuri Date: Mon, 9 Oct 2017 23:11:13 +0200 Subject: [PATCH] Fix supervisorctl restart postfix bug --- Makefile | 2 ++ README.md | 2 ++ docker-compose.elk.yml.dist | 3 ++- docker-compose.yml.dist | 3 ++- target/check_for_changes.sh | 5 ++--- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5a67b89a..cb2150d2 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ run: -e VIRUSMAILS_DELETE_DELAY=7 \ -e SASL_PASSWD="external-domain.com username:password" \ -e ENABLE_MANAGESIEVE=1 \ + --cap-add=SYS_PTRACE \ -e PERMIT_DOCKER=host \ -e DMS_DEBUG=0 \ -h mail.my-domain.com -t $(NAME) @@ -170,6 +171,7 @@ fixtures: docker cp "`pwd`/test/config/sieve/dovecot.sieve" mail:/var/mail/localhost.localdomain/user1/.dovecot.sieve docker exec mail /bin/sh -c "maildirmake.dovecot /var/mail/localhost.localdomain/user1/.INBOX.spam" docker exec mail /bin/sh -c "chown 5000:5000 -R /var/mail/localhost.localdomain/user1/.INBOX.spam" + sleep 20 # Sending test mails docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/amavis-spam.txt" docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/amavis-virus.txt" diff --git a/README.md b/README.md index 478be3c1..0d0b1809 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ services: - DMS_DEBUG=0 cap_add: - NET_ADMIN + - SYS_PTRACE volumes: maildata: @@ -125,6 +126,7 @@ services: - POSTMASTER_ADDRESS=postmaster@localhost.localdomain cap_add: - NET_ADMIN + - SYS_PTRACE volumes: maildata: diff --git a/docker-compose.elk.yml.dist b/docker-compose.elk.yml.dist index 58c704b9..16c77b43 100644 --- a/docker-compose.elk.yml.dist +++ b/docker-compose.elk.yml.dist @@ -2,7 +2,7 @@ version: '2' services: mail: - image: tvial/docker-mailserver:v2 + image: tvial/docker-mailserver:lastest hostname: mail domainname: domain.com container_name: mail @@ -21,6 +21,7 @@ services: - ENABLE_ELK_FORWARDER=1 cap_add: - NET_ADMIN + - SYS_PTRACE restart: always elk: build: elk diff --git a/docker-compose.yml.dist b/docker-compose.yml.dist index 4585eb13..26131f87 100644 --- a/docker-compose.yml.dist +++ b/docker-compose.yml.dist @@ -2,7 +2,7 @@ version: '2' services: mail: - image: tvial/docker-mailserver:2.1 + image: tvial/docker-mailserver:latest hostname: mail domainname: domain.com container_name: mail @@ -23,6 +23,7 @@ services: - DMS_DEBUG=0 cap_add: - NET_ADMIN + - SYS_PTRACE restart: always volumes: diff --git a/target/check_for_changes.sh b/target/check_for_changes.sh index ca27752d..215ef76d 100755 --- a/target/check_for_changes.sh +++ b/target/check_for_changes.sh @@ -107,9 +107,8 @@ if ! [ $resu_acc = "OK" ] || ! [ $resu_vir = "OK" ]; then chown -R 5000:5000 /var/mail fi - - #supervisorctl restart postfix # Buggy causes error while testing. - postfix reload + # Restart of the postfix + supervisorctl restart postfix # Prevent restart of dovecot when smtp_only=1 if [ ! -f $SMTP_ONLY = 1 ]; then