From cf873c35ebd47a659c9053b022cf3e5072f4d85e Mon Sep 17 00:00:00 2001 From: David Prevot Date: Wed, 26 Jul 2023 15:08:11 +0200 Subject: [PATCH] Fix USERDIR to delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure why we didn’t use directly the homeDirectory ldap entry, but just trying to minimize the patch by trying to figure out the path from the uid and domain… --- scripts/evoadmin.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/evoadmin.sh b/scripts/evoadmin.sh index eb36b53..3dbbddc 100755 --- a/scripts/evoadmin.sh +++ b/scripts/evoadmin.sh @@ -39,11 +39,12 @@ if [ "$PASSWORD" != "$READPASS" ]; then fi # mv pseudo-homeDir to directory. for deleted users +USERDIR=${USERIS%%@$DOMAINIS} if [ "$DEL" == "on" ]; then - if [[ -n $USERIS && -n $DOMAINIS && -e "/home/vmail/$DOMAINIS" && -e "/home/vmail/$DOMAINIS/$USERIS" ]]; then - mv /home/vmail/$DOMAINIS/$USERIS /home/vmail/$DOMAINIS/$USERIS.$DATE - chown -R root:root /home/vmail/$DOMAINIS/$USERIS.$DATE - chmod -R 700 /home/vmail/$DOMAINIS/$USERIS.$DATE + if [[ -n $USERIS && -n $DOMAINIS && -n $USERDIR && -e "/home/vmail/$DOMAINIS" && -e "/home/vmail/$DOMAINIS/$USERDIR" ]]; then + mv /home/vmail/$DOMAINIS/$USERDIR /home/vmail/$DOMAINIS/$USERDIR.$DATE + chown -R root:root /home/vmail/$DOMAINIS/$USERDIR.$DATE + chmod -R 700 /home/vmail/$DOMAINIS/$USERDIR.$DATE fi exit 0 fi