new SMTP_ONLY environment option to disable all courier daemons
This commit is contained in:
parent
3c2bc6ccac
commit
2769269bd6
8
Makefile
8
Makefile
|
@ -25,6 +25,12 @@ run:
|
||||||
-v "`pwd`/test":/tmp/test \
|
-v "`pwd`/test":/tmp/test \
|
||||||
-e ENABLE_POP3=1 \
|
-e ENABLE_POP3=1 \
|
||||||
-h mail.my-domain.com -t $(NAME)
|
-h mail.my-domain.com -t $(NAME)
|
||||||
|
docker run -d --name mail_smtponly \
|
||||||
|
-v "`pwd`/postfix":/tmp/postfix \
|
||||||
|
-v "`pwd`/spamassassin":/tmp/spamassassin \
|
||||||
|
-v "`pwd`/test":/tmp/test \
|
||||||
|
-e SMTP_ONLY=1 \
|
||||||
|
-h mail.my-domain.com -t $(NAME)
|
||||||
# Wait for containers to fully start
|
# Wait for containers to fully start
|
||||||
sleep 60
|
sleep 60
|
||||||
|
|
||||||
|
@ -47,4 +53,4 @@ clean:
|
||||||
# Get default files back
|
# Get default files back
|
||||||
git checkout postfix/accounts.cf postfix/virtual
|
git checkout postfix/accounts.cf postfix/virtual
|
||||||
# Remove running test containers
|
# Remove running test containers
|
||||||
docker rm -f mail mail_pop3
|
docker rm -f mail mail_pop3 mail_smtponly
|
||||||
|
|
|
@ -229,11 +229,15 @@ echo "Starting daemons"
|
||||||
cron
|
cron
|
||||||
/etc/init.d/rsyslog start
|
/etc/init.d/rsyslog start
|
||||||
/etc/init.d/saslauthd start
|
/etc/init.d/saslauthd start
|
||||||
|
|
||||||
|
if [ "$SMTP_ONLY" != 1 ]; then
|
||||||
|
|
||||||
/etc/init.d/courier-authdaemon start
|
/etc/init.d/courier-authdaemon start
|
||||||
/etc/init.d/courier-imap start
|
/etc/init.d/courier-imap start
|
||||||
/etc/init.d/courier-imap-ssl start
|
/etc/init.d/courier-imap-ssl start
|
||||||
|
|
||||||
if [ "$ENABLE_POP3" = 1 ]; then
|
fi
|
||||||
|
if [ "$ENABLE_POP3" = 1 -a "$SMTP_ONLY" != 1 ]; then
|
||||||
echo "Starting POP3 services"
|
echo "Starting POP3 services"
|
||||||
/etc/init.d/courier-pop start
|
/etc/init.d/courier-pop start
|
||||||
/etc/init.d/courier-pop-ssl start
|
/etc/init.d/courier-pop-ssl start
|
||||||
|
|
|
@ -47,10 +47,26 @@
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "checking process: courierpop3d (disabled using SMTP_ONLY)" {
|
||||||
|
run docker exec mail_smtponly /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/lib/courier/courier/courierpop3d'"
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# imap
|
# imap
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@test "checking process: courier imaplogin (enabled in default configuration)" {
|
||||||
|
run docker exec mail /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/lib/courier/courier/imaplogin'"
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "checking process: courier imaplogin (disabled using SMTP_ONLY)" {
|
||||||
|
run docker exec mail_smtponly /bin/bash -c "ps aux --forest | grep -v grep | grep '/usr/lib/courier/courier/imaplogin'"
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
}
|
||||||
|
|
||||||
@test "checking imap: server is ready with STARTTLS" {
|
@test "checking imap: server is ready with STARTTLS" {
|
||||||
run docker exec mail /bin/bash -c "nc -w 1 0.0.0.0 143 | grep '* OK' | grep 'STARTTLS' | grep 'Courier-IMAP ready'"
|
run docker exec mail /bin/bash -c "nc -w 1 0.0.0.0 143 | grep '* OK' | grep 'STARTTLS' | grep 'Courier-IMAP ready'"
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
|
Loading…
Reference in New Issue