mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
scripts: disallow alias = account (#3270)
This commit is contained in:
parent
4b937fda5b
commit
3f22cbce01
|
@ -74,6 +74,10 @@ function _arg_expect_mail_account
|
||||||
function _account_should_not_exist_yet
|
function _account_should_not_exist_yet
|
||||||
{
|
{
|
||||||
__account_already_exists && _exit_with_error "'${MAIL_ACCOUNT}' already exists"
|
__account_already_exists && _exit_with_error "'${MAIL_ACCOUNT}' already exists"
|
||||||
|
if [[ -f ${DATABASE_VIRTUAL} ]] && grep -q "^${MAIL_ACCOUNT}" "${DATABASE_VIRTUAL}"
|
||||||
|
then
|
||||||
|
_exit_with_error "'${MAIL_ACCOUNT}' is already defined as an alias"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Also used by delmailuser, setquota, delquota
|
# Also used by delmailuser, setquota, delquota
|
||||||
|
|
|
@ -25,6 +25,10 @@ function _manage_virtual_aliases
|
||||||
case "${ACTION}" in
|
case "${ACTION}" in
|
||||||
# Associate RECIPIENT to MAIL_ALIAS:
|
# Associate RECIPIENT to MAIL_ALIAS:
|
||||||
( 'update' )
|
( 'update' )
|
||||||
|
if [[ -f ${DATABASE_ACCOUNTS} ]] && grep -q "^${MAIL_ALIAS}" "${DATABASE_ACCOUNTS}"
|
||||||
|
then
|
||||||
|
_exit_with_error "'${MAIL_ALIAS}' is already defined as an account"
|
||||||
|
fi
|
||||||
_db_entry_add_or_append "${DATABASE_VIRTUAL}" "${MAIL_ALIAS}" "${RECIPIENT}"
|
_db_entry_add_or_append "${DATABASE_VIRTUAL}" "${MAIL_ALIAS}" "${RECIPIENT}"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue