...
 
Commits (4)
......@@ -25,6 +25,7 @@ all: $(CONTAINERS)
PHONY += deploy
deploy: $(CONTAINERS)
@test $(SERVER)
@echo -e "\n\nRun ssh root@$(SERVER) -L5000:localhost:5000\n\n"
@for i in $?; do \
docker tag $(ARCH)/email-$$i localhost:5000/$(ARCH)/email-$$i ; \
docker push localhost:5000/$(ARCH)/email-$$i ; \
......
......@@ -5,7 +5,8 @@
"networks": [ "post-spam" ],
"hostname": "mail",
"PUBDNS": [ "A:mail", "MX:mail:10" ],
"env": [ "SMTP=1" ]
"env": [ "SMTP=1" ],
"TLSCert": { "keydir":"/keys", "change":"/cert_change" }
},
"spamassassin": {
"networks": [ "post-spam", "spam-dove" ],
......@@ -15,20 +16,23 @@
"networks": [ "spam-dove", "private"],
"hostname": "imap",
"storagedirs": [ "/home/" ],
"PRIVDNS": [ "imap" ]
"PRIVDNS": [ "imap" ],
"TLSCert": { "keydir":"/keys", "change":"/cert_change" }
},
"roundcube": {
"networks": [ "private" ],
"hostname": "webmail",
"storagedirs": [ "/var/lib/dbconfig-common/sqlite3/roundcube/" ],
"PRIVDNS": [ "webmail" ]
"PRIVDNS": [ "webmail" ],
"TLSCert": { "keydir":"/keys", "change":"/cert_change" }
},
"submission": {
"networks": [ "private" ],
"hostname": "submission",
"PRIVDNS": [ "submission" ],
"env": [ "SUBMISSION=1" ],
"reuse": "postfix"
"reuse": "postfix",
"TLSCert": { "keydir":"/keys", "change":"/cert_change" }
}
}
}
......@@ -3,14 +3,22 @@ ARG FROM_PREFIX
FROM ${FROM_PREFIX}python3
#XXX Switch to nginx. May not be easy thanks for debian's deps.
#XXX --no-install-recommends?
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y roundcube roundcube-sqlite3 \
&& sed -i 's|/var/www/html|/var/lib/roundcube|g' /etc/apache2/sites-enabled/000-default.conf \
&& rm -rf /var/lib/apt/lists/*
COPY config.inc.php /etc/roundcube/
COPY php.ini /etc/php/7.0/apache2/conf.d/99-local.ini
RUN dpkg-reconfigure -f noninteractive roundcube-core \
RUN sed -i 's|/var/www/html|/var/lib/roundcube|g' /etc/apache2/sites-available/000-default.conf \
&& sed -i 's|/var/www/html|/var/lib/roundcube|g' /etc/apache2/sites-available/default-ssl.conf \
&& sed -i 's|/etc/ssl/certs/ssl-cert-snakeoil.pem|/keys/fullchain.pem|g' \
/etc/apache2/sites-available/default-ssl.conf \
&& sed -i 's|/etc/ssl/private/ssl-cert-snakeoil.key|/keys/privkey.pem|g' \
/etc/apache2/sites-available/default-ssl.conf \
&& a2ensite default-ssl \
&& a2enmod ssl \
&& dpkg-reconfigure -f noninteractive roundcube-core \
&& cat /var/lib/dbconfig-common/sqlite3/roundcube/roundcube | gzip > /rcdb.gz \
&& rm /var/lib/dbconfig-common/sqlite3/roundcube/roundcube
COPY start.sh /
......
......@@ -22,6 +22,8 @@ $config = array();
/* Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database ! */
include_once("/etc/roundcube/debian-db-roundcube.php");
$config['mail_domain'] = 'XXXMAILDOMAINXXX';
// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
......
......@@ -13,8 +13,9 @@ if [ ! -f /var/lib/dbconfig-common/sqlite3/roundcube/roundcube ]; then
fi
if grep -q XXXDESKEYXXX /etc/roundcube/config.inc.php; then
KEY=`dd if=/dev/urandom bs=1024 count=1 | base64 -w 0 | tr -d '=' | cut -c1-24`
sed -i "s/XXXDESKEYXXX/$KEY/g" /etc/roundcube/config.inc.php
KEY=`dd if=/dev/urandom bs=1024 count=1 | base64 -w 0 | tr -d '=' | td -d| cut -c1-24`
sed -i "s|XXXDESKEYXXX|$KEY|g" /etc/roundcube/config.inc.php
sed -i "s|XXXMAILDOMAINXXX|$DOMAINNAME|g" /etc/roundcube/config.inc.php
fi
exec apache2ctl -DFOREGROUND