Fix supervisorctl restart postfix bug

This commit is contained in:
kamuri 2017-10-09 23:11:13 +02:00
parent 6e39d63697
commit d436977dcf
5 changed files with 10 additions and 5 deletions

View File

@ -31,6 +31,7 @@ run:
-e VIRUSMAILS_DELETE_DELAY=7 \ -e VIRUSMAILS_DELETE_DELAY=7 \
-e SASL_PASSWD="external-domain.com username:password" \ -e SASL_PASSWD="external-domain.com username:password" \
-e ENABLE_MANAGESIEVE=1 \ -e ENABLE_MANAGESIEVE=1 \
--cap-add=SYS_PTRACE \
-e PERMIT_DOCKER=host \ -e PERMIT_DOCKER=host \
-e DMS_DEBUG=0 \ -e DMS_DEBUG=0 \
-h mail.my-domain.com -t $(NAME) -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 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 "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" docker exec mail /bin/sh -c "chown 5000:5000 -R /var/mail/localhost.localdomain/user1/.INBOX.spam"
sleep 20
# Sending test mails # 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-spam.txt"
docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/amavis-virus.txt" docker exec mail /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/amavis-virus.txt"

View File

@ -71,6 +71,7 @@ services:
- DMS_DEBUG=0 - DMS_DEBUG=0
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
- SYS_PTRACE
volumes: volumes:
maildata: maildata:
@ -125,6 +126,7 @@ services:
- POSTMASTER_ADDRESS=postmaster@localhost.localdomain - POSTMASTER_ADDRESS=postmaster@localhost.localdomain
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
- SYS_PTRACE
volumes: volumes:
maildata: maildata:

View File

@ -2,7 +2,7 @@ version: '2'
services: services:
mail: mail:
image: tvial/docker-mailserver:v2 image: tvial/docker-mailserver:lastest
hostname: mail hostname: mail
domainname: domain.com domainname: domain.com
container_name: mail container_name: mail
@ -21,6 +21,7 @@ services:
- ENABLE_ELK_FORWARDER=1 - ENABLE_ELK_FORWARDER=1
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
- SYS_PTRACE
restart: always restart: always
elk: elk:
build: elk build: elk

View File

@ -2,7 +2,7 @@ version: '2'
services: services:
mail: mail:
image: tvial/docker-mailserver:2.1 image: tvial/docker-mailserver:latest
hostname: mail hostname: mail
domainname: domain.com domainname: domain.com
container_name: mail container_name: mail
@ -23,6 +23,7 @@ services:
- DMS_DEBUG=0 - DMS_DEBUG=0
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
- SYS_PTRACE
restart: always restart: always
volumes: volumes:

View File

@ -107,9 +107,8 @@ if ! [ $resu_acc = "OK" ] || ! [ $resu_vir = "OK" ]; then
chown -R 5000:5000 /var/mail chown -R 5000:5000 /var/mail
fi fi
# Restart of the postfix
#supervisorctl restart postfix # Buggy causes error while testing. supervisorctl restart postfix
postfix reload
# Prevent restart of dovecot when smtp_only=1 # Prevent restart of dovecot when smtp_only=1
if [ ! -f $SMTP_ONLY = 1 ]; then if [ ! -f $SMTP_ONLY = 1 ]; then