From 732d5ab620aee0b6faca8bbe0204bef37200782a Mon Sep 17 00:00:00 2001 From: guidohu Date: Sun, 28 Jun 2020 18:14:40 +0200 Subject: [PATCH 1/5] use latest ubuntu 20.04 --- Dockerfile | 7 +++---- assets/install.sh | 22 +++------------------- build.sh | 3 +-- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5395bf5..d80fc6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ -From ubuntu:trusty -MAINTAINER Elliott Ye +FROM ubuntu:focal # Set noninteractive mode for apt-get ENV DEBIAN_FRONTEND noninteractive @@ -9,10 +8,10 @@ RUN apt-get update # Start editing # Install package here for cache -RUN apt-get -y install supervisor postfix sasl2-bin opendkim opendkim-tools +RUN apt-get -y install postfix sasl2-bin opendkim opendkim-tools # Add files ADD assets/install.sh /opt/install.sh # Run -CMD /opt/install.sh;/usr/bin/supervisord -c /etc/supervisor/supervisord.conf +CMD /opt/install.sh;/opt/postfix.sh \ No newline at end of file diff --git a/assets/install.sh b/assets/install.sh index 0b2aaff..e410bdf 100755 --- a/assets/install.sh +++ b/assets/install.sh @@ -1,32 +1,16 @@ #!/bin/bash -#judgement -if [[ -a /etc/supervisor/conf.d/supervisord.conf ]]; then - exit 0 -fi - -#supervisor -cat > /etc/supervisor/conf.d/supervisord.conf <> /opt/postfix.sh < Date: Mon, 29 Jun 2020 21:45:33 +0200 Subject: [PATCH 2/5] fix mydestination setting to be a relay --- assets/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/install.sh b/assets/install.sh index e410bdf..155a609 100755 --- a/assets/install.sh +++ b/assets/install.sh @@ -11,6 +11,7 @@ EOF chmod +x /opt/postfix.sh postconf -e myhostname=$maildomain postconf -e maillog_file=/dev/stdout +postconf -e mydestination="localhost.localdomain,localhost" postconf -F '*/*/chroot = n' ############ @@ -111,4 +112,4 @@ cat >> /etc/opendkim/SigningTable < Date: Tue, 30 Jun 2020 22:38:12 +0200 Subject: [PATCH 3/5] adjust container name --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 955a64c..c7b505a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ TLS and OpenDKIM support are optional. 1. Build image ```bash - $ sudo docker pull catatnight/postfix + $ sudo docker pull guhu/postfix ``` ## Usage @@ -20,7 +20,7 @@ TLS and OpenDKIM support are optional. ```bash $ sudo docker run -p 25:25 \ -e maildomain=mail.example.com -e smtp_user=user:pwd \ - --name postfix -d catatnight/postfix + --name postfix -d guhu/postfix # Set multiple user credentials: -e smtp_user=user1:pwd1,user2:pwd2,...,userN:pwdN ``` 2. Enable OpenDKIM: save your domain key ```.private``` in ```/path/to/domainkeys``` @@ -29,7 +29,7 @@ TLS and OpenDKIM support are optional. $ sudo docker run -p 25:25 \ -e maildomain=mail.example.com -e smtp_user=user:pwd \ -v /path/to/domainkeys:/etc/opendkim/domainkeys \ - --name postfix -d catatnight/postfix + --name postfix -d guhu/postfix ``` 3. Enable TLS(587): save your SSL certificates ```.key``` and ```.crt``` to ```/path/to/certs``` @@ -37,7 +37,7 @@ TLS and OpenDKIM support are optional. $ sudo docker run -p 587:587 \ -e maildomain=mail.example.com -e smtp_user=user:pwd \ -v /path/to/certs:/etc/postfix/certs \ - --name postfix -d catatnight/postfix + --name postfix -d guhu/postfix ``` ## Note From 4a9d8a78d54df014ef6d370ae3eb63db7009e613 Mon Sep 17 00:00:00 2001 From: guidohu Date: Sun, 2 Aug 2020 14:00:11 +0200 Subject: [PATCH 4/5] update README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c7b505a..65e4727 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ docker-postfix ============== -run postfix with smtp authentication (sasldb) in a docker container. +**Note** This project is forked from [catatnight/docker-postfix](https://github.com/catatnight/docker-postfix) to provide the same functionality with updated packages. + +Run postfix with smtp authentication (sasldb) in a docker container. TLS and OpenDKIM support are optional. ## Requirement From 479507d87811f317433bb8992867d2bce244df7e Mon Sep 17 00:00:00 2001 From: guidohu Date: Sun, 2 Aug 2020 14:05:50 +0200 Subject: [PATCH 5/5] revert to minimum changes for version updates --- README.md | 12 +++++------- build.sh | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 65e4727..955a64c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ docker-postfix ============== -**Note** This project is forked from [catatnight/docker-postfix](https://github.com/catatnight/docker-postfix) to provide the same functionality with updated packages. - -Run postfix with smtp authentication (sasldb) in a docker container. +run postfix with smtp authentication (sasldb) in a docker container. TLS and OpenDKIM support are optional. ## Requirement @@ -13,7 +11,7 @@ TLS and OpenDKIM support are optional. 1. Build image ```bash - $ sudo docker pull guhu/postfix + $ sudo docker pull catatnight/postfix ``` ## Usage @@ -22,7 +20,7 @@ TLS and OpenDKIM support are optional. ```bash $ sudo docker run -p 25:25 \ -e maildomain=mail.example.com -e smtp_user=user:pwd \ - --name postfix -d guhu/postfix + --name postfix -d catatnight/postfix # Set multiple user credentials: -e smtp_user=user1:pwd1,user2:pwd2,...,userN:pwdN ``` 2. Enable OpenDKIM: save your domain key ```.private``` in ```/path/to/domainkeys``` @@ -31,7 +29,7 @@ TLS and OpenDKIM support are optional. $ sudo docker run -p 25:25 \ -e maildomain=mail.example.com -e smtp_user=user:pwd \ -v /path/to/domainkeys:/etc/opendkim/domainkeys \ - --name postfix -d guhu/postfix + --name postfix -d catatnight/postfix ``` 3. Enable TLS(587): save your SSL certificates ```.key``` and ```.crt``` to ```/path/to/certs``` @@ -39,7 +37,7 @@ TLS and OpenDKIM support are optional. $ sudo docker run -p 587:587 \ -e maildomain=mail.example.com -e smtp_user=user:pwd \ -v /path/to/certs:/etc/postfix/certs \ - --name postfix -d guhu/postfix + --name postfix -d catatnight/postfix ``` ## Note diff --git a/build.sh b/build.sh index 653e169..e8245ad 100755 --- a/build.sh +++ b/build.sh @@ -1,2 +1,2 @@ #!/bin/bash -docker build -t guhu/postfix . +docker build -t catatnight/postfix .