* Fixes #546 & #560 - comments and new lines should not be parsed
This commit is contained in:
parent
fe8287f60a
commit
912cb5676b
|
@ -463,7 +463,7 @@ function _setup_dovecot_local_user() {
|
||||||
|
|
||||||
# Creating users
|
# Creating users
|
||||||
# 'pass' is encrypted
|
# 'pass' is encrypted
|
||||||
while IFS=$'|' read login pass
|
grep "^[a-z]" /tmp/docker-mailserver/postfix-accounts.cf | while IFS=$'|' read login pass
|
||||||
do
|
do
|
||||||
# Setting variables for better readability
|
# Setting variables for better readability
|
||||||
user=$(echo ${login} | cut -d @ -f1)
|
user=$(echo ${login} | cut -d @ -f1)
|
||||||
|
@ -488,7 +488,7 @@ function _setup_dovecot_local_user() {
|
||||||
# Copy user provided sieve file, if present
|
# Copy user provided sieve file, if present
|
||||||
test -e /tmp/docker-mailserver/${login}.dovecot.sieve && cp /tmp/docker-mailserver/${login}.dovecot.sieve /var/mail/${domain}/${user}/.dovecot.sieve
|
test -e /tmp/docker-mailserver/${login}.dovecot.sieve && cp /tmp/docker-mailserver/${login}.dovecot.sieve /var/mail/${domain}/${user}/.dovecot.sieve
|
||||||
echo ${domain} >> /tmp/vhost.tmp
|
echo ${domain} >> /tmp/vhost.tmp
|
||||||
done < /tmp/docker-mailserver/postfix-accounts.cf
|
done
|
||||||
else
|
else
|
||||||
notify 'warn' "'config/docker-mailserver/postfix-accounts.cf' is not provided. No mail account created."
|
notify 'warn' "'config/docker-mailserver/postfix-accounts.cf' is not provided. No mail account created."
|
||||||
fi
|
fi
|
||||||
|
@ -805,7 +805,10 @@ function _setup_postfix_override_configuration() {
|
||||||
|
|
||||||
if [ -f /tmp/docker-mailserver/postfix-main.cf ]; then
|
if [ -f /tmp/docker-mailserver/postfix-main.cf ]; then
|
||||||
while read line; do
|
while read line; do
|
||||||
|
# line should start with a letter (avoid comments and new lines)
|
||||||
|
if [[ "$line" =~ ^[a-z] ]]; then
|
||||||
postconf -e "$line"
|
postconf -e "$line"
|
||||||
|
fi
|
||||||
done < /tmp/docker-mailserver/postfix-main.cf
|
done < /tmp/docker-mailserver/postfix-main.cf
|
||||||
notify 'inf' "Loaded 'config/postfix-main.cf'"
|
notify 'inf' "Loaded 'config/postfix-main.cf'"
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
recipient_delimiter = ~
|
recipient_delimiter = ~
|
||||||
max_idle = 600s
|
max_idle = 600s
|
||||||
|
# this is a comment
|
||||||
readme_directory = /tmp
|
readme_directory = /tmp
|
||||||
|
|
||||||
|
|
|
@ -346,6 +346,11 @@ load 'test_helper/bats-assert/load'
|
||||||
assert_output 7
|
assert_output 7
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "checking accounts: comments are not parsed" {
|
||||||
|
run docker exec mail /bin/bash -c "ls /var/mail | grep 'comment'"
|
||||||
|
assert_failure
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# postfix
|
# postfix
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue