docker-postfix/test.sh
Bojan Čekrlić cd4f64a8ce Fixes for DKIM implementation
Important note: DKIM segment is hardcoded to "mail" in the
configuration.

You shouldn't be using any other segment name.

If you don't know what that means: DKIM checks your DNS server
for this segment name by querying `<segment>._domainkey.<domain>`.

So, when saying you need to use the `mail` segment this means that
the record *must* reside under `mail._domainkey.<domain>`.
2019-03-07 08:29:50 +01:00

36 lines
572 B
Bash
Executable file

#!/bin/sh
docker build . -t boky/postfix
docker-compose up -d
FROM=$1
TO=$2
# Wait for postfix to startup
echo "Waiting for startup..."
while ! docker ps | fgrep postfix_test_587 | grep -q healthy; do
sleep 1
done
cat <<EOF | nc -C localhost 1587
HELO test
MAIL FROM:$FROM
RCPT TO:$TO
DATA
Subject: Postfix message test
From: $FROM
To: $TO
Date: $(date)
Content-Type: text/plain
This is a simple text of message sending using boky/postfix.
.
QUIT
EOF
# Wait for email to be delivered
echo "Waiting to shutdown..."
sleep 5
# Shut down tests
docker-compose down