From 7e47e457ac66ada89eb4d8c62eea587c22643787 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 25 Aug 2015 19:35:54 +0200 Subject: [PATCH] Allow to set "mynetworks" variable in postfix main.cf --- core/README.md | 2 ++ core/boot | 4 ++++ core/config/example/postfix-networks | 1 + 3 files changed, 7 insertions(+) create mode 100644 core/config/example/postfix-networks diff --git a/core/README.md b/core/README.md index eac7630..ba16c2d 100644 --- a/core/README.md +++ b/core/README.md @@ -37,6 +37,8 @@ Use the the example config files in `config/example` to get you started. 4. Change the hostname in file `/var/lib/dockermail/settings/myhostname` to the correct fully qualified domain of your server. +5. Set the "mynetworks" variable for postfix in file `/var/lib/dockermail/settings/postfix-networks` to e.g. `127.0.0.0/8 [::1]/128` (one single line only). + 5. Build container docker build -t dockermail_email_core . diff --git a/core/boot b/core/boot index 3bb7cb4..54cf40f 100755 --- a/core/boot +++ b/core/boot @@ -47,6 +47,10 @@ chmod u+w /vmail # Add password file cp /mail_settings/passwords /etc/dovecot/passwd +# set mynetworks +sed -i \ + -e "s#^mynetworks = .*#mynetworks = $(cat /mail_settings/postfix-networks | tr -d '\n')#" \ + /etc/postfix/main.cf # Run boot scripts for SCRIPT in /boot.d/* diff --git a/core/config/example/postfix-networks b/core/config/example/postfix-networks new file mode 100644 index 0000000..06fd987 --- /dev/null +++ b/core/config/example/postfix-networks @@ -0,0 +1 @@ +127.0.0.0/8 [::1]/128