From 8dd58ad45644936d07546c7fafbe8a43de018d03 Mon Sep 17 00:00:00 2001 From: Zehir Date: Mon, 5 Sep 2016 17:47:06 +0200 Subject: [PATCH] Ignore commented or empty lines from config file --- target/start-mailserver.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index fbf0fd62..c8596d92 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -69,6 +69,7 @@ if [ -f /tmp/docker-mailserver/postfix-virtual.cf ]; then cp /tmp/docker-mailserver/postfix-virtual.cf /etc/postfix/virtual while read from to do + ([[ "$from" =~ ^#.*$ ]] || [ -z "$from" ] ) && continue # Setting variables for better readability uname=$(echo ${from} | cut -d @ -f1) domain=$(echo ${from} | cut -d @ -f2) @@ -262,6 +263,7 @@ esac # if [ -f /tmp/docker-mailserver/postfix-main.cf ]; then while read line; do + ([[ "$line" =~ ^#.*$ ]] || [ -z "$line" ] ) && continue postconf -e "$line" done < /tmp/docker-mailserver/postfix-main.cf echo "Loaded 'config/postfix-main.cf'"