Loading scripts/delete-account.sh +10 −0 Original line number Diff line number Diff line Loading @@ -19,5 +19,15 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then echo "Deleting email account" docker-compose exec -T postfixadmin /postfixadmin/scripts/postfixadmin-cli mailbox delete "$ACCOUNT" #Fix #951 #sed pattern : \:$account$ = # line ending with $ACCOUNT ($), # and : before $account to prevent accidental deletion ex : if $ACCOUNT = doe do NOT delete all lines end with doe, johndoe, john-doe,... # is this enough? # do we enforce this with a dry run? if only one line deleted, we actually delete, if do not and and raise an alert? FILE_MULTIPLE_REGISTRATION_CHECK=/mnt/repo-base/volumes/accounts/auth.file.done echo "Removing $ACCOUNT from file $FILE_MULTIPLE_REGISTRATION_CHECK " sed -i "/\:$ACCOUNT$/d" $FILE_MULTIPLE_REGISTRATION_CHECK # TODO: delete onlyoffice account??? fi Loading
scripts/delete-account.sh +10 −0 Original line number Diff line number Diff line Loading @@ -19,5 +19,15 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then echo "Deleting email account" docker-compose exec -T postfixadmin /postfixadmin/scripts/postfixadmin-cli mailbox delete "$ACCOUNT" #Fix #951 #sed pattern : \:$account$ = # line ending with $ACCOUNT ($), # and : before $account to prevent accidental deletion ex : if $ACCOUNT = doe do NOT delete all lines end with doe, johndoe, john-doe,... # is this enough? # do we enforce this with a dry run? if only one line deleted, we actually delete, if do not and and raise an alert? FILE_MULTIPLE_REGISTRATION_CHECK=/mnt/repo-base/volumes/accounts/auth.file.done echo "Removing $ACCOUNT from file $FILE_MULTIPLE_REGISTRATION_CHECK " sed -i "/\:$ACCOUNT$/d" $FILE_MULTIPLE_REGISTRATION_CHECK # TODO: delete onlyoffice account??? fi