mirror of
https://github.com/mjl-/mox.git
synced 2024-12-27 08:53:48 +03:00
05fd5c6947
with tls with acme (with pebble, a small acme server for testing), and with pregenerated keys/certs. the two mox instances are configured on their own domain. we launch a separate test container that connects to the first, submits a message for delivery to the second. we check if the message is delivered with an imap connection and the idle command.
36 lines
1.2 KiB
Bash
Executable file
36 lines
1.2 KiB
Bash
Executable file
#!/bin/sh
|
|
set -x # print commands
|
|
set -e # exit on failed command
|
|
|
|
apk add unbound
|
|
|
|
(rm -r /tmp/mox 2>/dev/null || exit 0) # clean slate
|
|
mkdir /tmp/mox
|
|
cd /tmp/mox
|
|
mox quickstart moxtest2@mox2.example "$MOX_UID" > output.txt
|
|
|
|
sed -i -e '/- 172.28.1.20/d' -e 's/- 0.0.0.0/- 172.28.1.20/' -e '/- ::/d' -e 's,ACME: .*$,KeyCerts:\n\t\t\t\t-\n\t\t\t\t\tCertFile: /quickstart/tls/moxmail2.pem\n\t\t\t\t\tKeyFile: /quickstart/tls/moxmail2-key.pem\n\t\t\t\t-\n\t\t\t\t\tCertFile: /quickstart/tls/mox2-autoconfig.pem\n\t\t\t\t\tKeyFile: /quickstart/tls/mox2-autoconfig-key.pem\n\t\t\t\t-\n\t\t\t\t\tCertFile: /quickstart/tls/mox2-mtasts.pem\n\t\t\t\t\tKeyFile: /quickstart/tls/mox2-mtasts-key.pem\n,' config/mox.conf
|
|
cat <<EOF >>config/mox.conf
|
|
|
|
TLS:
|
|
CA:
|
|
CertFiles:
|
|
# CA of our own certificates.
|
|
- /quickstart/tls/ca.pem
|
|
# CA used by moxacmepebble.
|
|
- /quickstart/tmp-pebble-ca.pem
|
|
EOF
|
|
|
|
# A fresh file was set up by moxacmepebble.
|
|
sed -n '/^;/,/IN CAA/p' output.txt >>/quickstart/example-quickstart.zone
|
|
unbound-control -s 172.28.1.30 reload # reload unbound with zone file changes
|
|
|
|
mox serve &
|
|
while true; do
|
|
if test -e data/ctl; then
|
|
echo -n accountpass4321 | mox setaccountpassword moxtest2@mox2.example
|
|
break
|
|
fi
|
|
sleep 0.1
|
|
done
|
|
wait
|