Allow setting ACL_ANYONE in the configuration

This commit is contained in:
Markus Heberling
2018-11-18 13:31:09 +01:00
parent d627934bd9
commit 4755bb323b
6 changed files with 30 additions and 4 deletions

View File

@@ -121,6 +121,7 @@ CONFIG_ARRAY=(
"API_KEY"
"API_ALLOW_FROM"
"MAILDIR_GC_TIME"
"ACL_ANYONE"
)
sed -i '$a\' mailcow.conf
@@ -202,6 +203,19 @@ for option in ${CONFIG_ARRAY[@]}; do
echo '# Check interval is hourly' >> mailcow.conf
echo 'MAILDIR_GC_TIME=1440' >> mailcow.conf
fi
elif [[ ${option} == "ACL_ANYONE" ]]; then
if ! grep -q ${option} mailcow.conf; then
echo "Adding new option \"${option}\" to mailcow.conf"
echo '# Set this to allow to enable the anyone pseudo user. Disabled by default.
' >> mailcow.conf
echo '# When enabled, ACL can be created, that apply to "All authenticated users"
' >> mailcow.conf
echo '# This should probably only be activated on mail hosts, that are used exclusivly by one organisation.
' >> mailcow.conf
echo '# Otherwise a user might share data with too many other users.
' >> mailcow.conf
echo 'ACL_ANYONE=disallow' >> mailcow.conf
fi
elif ! grep -q ${option} mailcow.conf; then
echo "Adding new option \"${option}\" to mailcow.conf"
echo "${option}=n" >> mailcow.conf