Commit 02f23511 authored by Nolan's avatar Nolan

Switch to new appstore style app.

Upload via the registry, .json instead of a shellsript,
and modifications to the expected dns names and how IPs
on the various networks are determined.
parent 2b4b367c
docker build --build-arg FROM_PREFIX=arm32v7/ -t spamassassin ./spamassassin
docker build --build-arg FROM_PREFIX=$(ARCH)/ -t $(ARCH)/email-spamassassin ./spamassassin
CONTAINERS += spamassassin
docker build --build-arg FROM_PREFIX=arm32v7/ -t dovecot ./dovecot
docker build --build-arg FROM_PREFIX=$(ARCH)/ -t $(ARCH)/email-dovecot ./dovecot
CONTAINERS += dovecot
docker build --build-arg FROM_PREFIX=arm32v7/ -t postfix ./postfix
docker build --build-arg FROM_PREFIX=$(ARCH)/ -t $(ARCH)/email-postfix ./postfix
CONTAINERS += postfix
......@@ -15,11 +18,13 @@ PHONY += $(CONTAINERS)
PHONY += all
#XXX Remove the -0 from xz when things are stable.
PHONY += deploy
deploy: $(CONTAINERS)
@test $(SERVER)
docker save $? | xz -0 | pv -W | ssh root@$(SERVER) 'cat>data/sslnginx/html/apps/email.tar.xz'
scp startemail root@$(SERVER):~/data/sslnginx/html/apps/
@for i in $?; do \
docker tag $(ARCH)/email-$$i localhost:5000/$(ARCH)/email-$$i ; \
docker push localhost:5000/$(ARCH)/email-$$i ; \
scp email.json root@$(SERVER):~/data/sslnginx/html/apps/
......@@ -9,7 +9,7 @@ openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
-out /etc/dovecot/dovecot.pem -keyout /etc/dovecot/private/dovecot.pem \
-subj "/C=US/ST=CA/L=CA/O=none/OU=none/CN=$DOMAINNAME/emailAddress=postmaster@$DOMAINNAME"
LMTPIP=`ip -o addr | grep -Eo $SPAM_SUBNET.[0-9]+`
LMTPIP=`ip -o addr show to $spam-dove_SUBNET | cut -d'/' -f1 | cut -d' ' -f7`
sed -i -e "s/XXXLMTPIPXXX/$LMTPIP/g" /etc/dovecot/conf.d/10-master.conf
/usr/sbin/dovecot -F -c /etc/dovecot/dovecot.conf
"containers": {
"postfix": {
"expose": [ [ "25", "25" ] ],
"networks": [ "post-spam" ],
"hostname": "mail",
"PUBDNS": [ "A:mail", "MX:mail:10" ]
"spamassassin": {
"networks": [ "post-spam", "spam-dove" ],
"hostname": "spamassassin"
"dovecot": {
"networks": [ "spam-dove", "private"],
"hostname": "imap",
"storagedirs": [ "/home/" ],
"PRIVDNS": [ "imap" ]
......@@ -40,5 +40,5 @@ recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
mailbox_transport = lmtp:inet:spamassassin
virtual_transport = lmtp:inet:spamassassin
mailbox_transport = lmtp:inet:email-spamassassin
virtual_transport = lmtp:inet:email-spamassassin
PF_IP=`ip -o addr | grep -Eo $PF_SUBNET.[0-9]+`
spampd --host=$PF_IP:24 --relayhost=dovecot:24 \
PF_IP=`ip -o addr show to $post-spam_SUBNET | cut -d'/' -f1 | cut -d' ' -f7`
spampd --host=$PF_IP:24 --relayhost=email-dovecot:24 \
--children=2 --nodetach --maxsize=65535 --tagall
#XXX Obviously this needs to be a declarative format, downloading and running
# sh code on the host is a non-starter...
#XXX Change these networks to be Unix Domain Sockets passed in with -v?
docker network create --internal post-spam
docker network create --internal spam-dove
docker create -v /dev/log:/dev/log -p 25:25 -e DOMAINNAME=$DOMAINNAME -e USERNAME=nolan --hostname mail --name postfix postfix
docker network connect post-spam postfix
PF_SUBNET=`docker network inspect post-spam --format '{{(index .IPAM.Config 0).Subnet}}' | cut -d'.' -f1-3`
docker create -v /dev/log:/dev/log -e PF_SUBNET=$PF_SUBNET --net post-spam --hostname spamassassin --name spamassassin spamassassin
docker network connect spam-dove spamassassin
SPAM_SUBNET=`docker network inspect spam-dove --format '{{(index .IPAM.Config 0).Subnet}}' | cut -d'.' -f1-3`
docker create -v /dev/log:/dev/log -e DOMAINNAME=$DOMAINNAME -e USERNAME=nolan -e SPAM_SUBNET=$SPAM_SUBNET --net private --hostname imap --name dovecot dovecot
docker network connect spam-dove dovecot
docker start dovecot
docker start spamassassin
docker start postfix
bash /mnt/sda1/dnsc '["add","imap","A",""]'
#bash /mnt/sda1/dnsc '["add","mail","A","PUBLIC_IP"]'
#bash /mnt/sda1/dnsc '["add","@","MX",["",10]]'
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment