From 4536113a302150df1d792652c81f6e65667b6601 Mon Sep 17 00:00:00 2001 From: mplx Date: Fri, 7 Apr 2017 22:28:19 +0200 Subject: [PATCH] allow accounts which do not start with a-z (#568) --- target/start-mailserver.sh | 6 ++++-- test/config/postfix-main.cf | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index a21272bf..d4b4f543 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -463,7 +463,8 @@ function _setup_dovecot_local_user() { # Creating users # 'pass' is encrypted - grep "^[a-z]" /tmp/docker-mailserver/postfix-accounts.cf | while IFS=$'|' read login pass + # comments and empty lines are ignored + grep -v "^\s*$\|^\s*\#" /tmp/docker-mailserver/postfix-accounts.cf | while IFS=$'|' read login pass do # Setting variables for better readability user=$(echo ${login} | cut -d @ -f1) @@ -805,7 +806,8 @@ function _setup_postfix_override_configuration() { if [ -f /tmp/docker-mailserver/postfix-main.cf ]; then while read line; do - # line should start with a letter (avoid comments and new lines) + # all valid postfix options start with a lower case letter + # http://www.postfix.org/postconf.5.html if [[ "$line" =~ ^[a-z] ]]; then postconf -e "$line" fi diff --git a/test/config/postfix-main.cf b/test/config/postfix-main.cf index 57772ca1..38f0bb26 100644 --- a/test/config/postfix-main.cf +++ b/test/config/postfix-main.cf @@ -1,5 +1,5 @@ recipient_delimiter = ~ max_idle = 600s # this is a comment + # this is also a comment readme_directory = /tmp -