That’s not a valid email error

This might be due to your solution in step 1. Try with a clean installation, or remove env directory under /usr/local/lib/mailinabox/, then try the solution described in the other thread using

export DEB_PYTHON_INSTALL_LAYOUT='deb'
curl -s https://mailinabox.email/setup.sh | sudo -E bash