Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97b7d2cd authored by Florent VINCENT's avatar Florent VINCENT 👾
Browse files

fix #951 account deletion remove $ACCOUNT line from repo-base/volumes/accounts/auth.file.done

parent 80a41104
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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