diff --git a/docker/add-user.sh b/docker/add-user.sh index 7145a5e..e53ffdc 100755 --- a/docker/add-user.sh +++ b/docker/add-user.sh @@ -30,11 +30,7 @@ ENCPASS=$(doveadm pw -u "${EMAIL}" -p "${PASSWORD}") # Edit dovecot users: remove user if it exits. mkdir -p /data/dovecot touch /data/dovecot/users -if grep -q "^${EMAIL}:" /data/dovecot/users; then - cp /data/dovecot/users /data/dovecot/users.old - grep -v "^${EMAIL}:" /data/dovecot/users.old \ - > /data/dovecot/users -fi +sed -i "/^${EMAIL}/d" /data/dovecot/users # Edit dovecot users: add user. echo "${EMAIL}:${ENCPASS}::::" >> /data/dovecot/users