scripts: disallow alias = account (#3270)

This commit is contained in:
Georg Lauterbach 2023-04-17 19:22:50 +02:00 committed by GitHub
parent 4b937fda5b
commit 3f22cbce01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -25,6 +25,10 @@ function _manage_virtual_aliases
case "${ACTION}" in
# Associate RECIPIENT to MAIL_ALIAS:
( '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}"
;;