Browse Source

postmap paths in $POSTMAP_PATHS

Fabian Peter Hammerle 4 years ago
parent
commit
3b0312ed15
2 changed files with 11 additions and 1 deletions
  1. 4 0
      docker-compose.yml
  2. 7 1
      postfix.sh

+ 4 - 0
docker-compose.yml

@@ -5,6 +5,10 @@ services:
     build: .
     image: fphammerle/postfix
     ports: ['127.0.0.1:25:25']
+    environment:
+      POSTMAP_PATHS: |
+        /etc/postfix/edit-docker-compose.yml
+        /etc/postfix/replace-me
     security_opt: [no-new-privileges]
     restart: unless-stopped
 

+ 7 - 1
postfix.sh

@@ -1,6 +1,12 @@
 #!/bin/sh
 
-set -ex
+set -e
+
+echo "$POSTMAP_PATHS" | while IFS= read -r postmap_path; do
+    [ -z "$postmap_path" ] || (set -x; postmap "$postmap_path")
+done
+
+set -x
 
 # http://www.postfix.org/postconf.5.html#alias_database
 # http://www.postfix.org/newaliases.1.html