8be9575a by Adam Heath

Importing into a fresh repository.

1 parent 4c82e509
1 FROM docker.brainfood.com/dumb-init
2
3 ADD /overlay/ /
4
5 # export DEBIAN_FRONTEND=noninteractive RUNLEVEL=1
6 RUN ["apt-docker", \
7 "-y", "install", "bsd-mailx", "postfix", "dovecot-imapd", \
8 ";" ]
9
10 EXPOSE 25 143
11 VOLUME ["/home"]
1 version: '2'
2
3 services:
4 build:
5 image: docker.brainfood.com/mail
6 build:
7 context: .
8 args:
9 - http_proxy
10 - https_proxy
11
1 #!/bin/bash
2
3 HOSTNAME=$(hostname -f)
4
5 postconf -e \
6 "myhostname = $HOSTNAME" \
7 "mydestination = $HOSTNAME, localhost.localdomain, localhost" \
8 "mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/8 172.0.0.0/8"\
9 "inet_protocols = all" \
10 "relayhost = $POSTFIX_RELAYHOST" \
11 "virtual_maps = hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual-regexp" \
12 "home_mailbox = Maildir/" \
13 && true
14
15 touch /etc/postfix/virtual
16 postmap /etc/postfix/virtual
17
18 if [[ $POSTFIX_REDIRECT_MAIL_LOCALHOST ]]; then
19 echo "/.+@.+/ $POSTFIX_REDIRECT_MAIL_LOCALHOST@localhost" > /etc/postfix/virtual-regexp
20 if ! getent passwd $POSTFIX_REDIRECT_MAIL_LOCALHOST > /dev/null; then
21 adduser --disabled-password --gecos "$POSTFIX_REDIRECT_MAIL_LOCALHOST" $POSTFIX_REDIRECT_MAIL_LOCALHOST
22 fi
23 echo "$POSTFIX_REDIRECT_MAIL_LOCALHOST:$POSTFIX_REDIRECT_MAIL_LOCALHOST" | chpasswd
24 else
25 : > /etc/postfix/virtual-regexp
26 fi
27
1 mail_location = maildir:~/Maildir
2 disable_plaintext_auth = no