From a84b8a130cf9d32f62bdea19fccbf9c54f59dbd6 Mon Sep 17 00:00:00 2001 From: Thomas VIAL Date: Wed, 15 Jun 2022 12:31:58 +0200 Subject: [PATCH] fix: Dovecot Quota dummy accounts for aliases should check for existing users with an exact user key lookup (#2640) Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> --- target/scripts/helpers/accounts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/scripts/helpers/accounts.sh b/target/scripts/helpers/accounts.sh index dc57945d..92d06615 100644 --- a/target/scripts/helpers/accounts.sh +++ b/target/scripts/helpers/accounts.sh @@ -157,7 +157,7 @@ function _create_dovecot_alias_dummy_accounts fi DOVECOT_USERDB_LINE="${ALIAS}:${REAL_ACC[1]}:5000:5000::/var/mail/${REAL_DOMAINNAME}/${REAL_USERNAME}::${REAL_ACC[2]:-}" - if grep -qF "${DOVECOT_USERDB_LINE}" "${DOVECOT_USERDB_FILE}" + if grep -qi "^${ALIAS}:" "${DOVECOT_USERDB_FILE}" then _log 'warn' "Alias '${ALIAS}' will not be added to '${DOVECOT_USERDB_FILE}' twice" else