Because this is a unsupported modification, you may face issues when upgrading. I also didn’t test the modification so it may break:
Get into a root shell:
sudo -i
Rename the configuration file exposing /mail and /admin to something else, and create an empty file in it’s place
mv mailinabox/conf/nginx-primaryonly.conf mailinabox/conf/nginx-primaryonly-old.conf
touch mailinabox/conf/nginx-primaryonly.conf
mailinabox # Rerun the setup
If something breaks, you can easily revert the changes by using git:
# If not as root: sudo -i
cd mailinabox
git stash
mailinabox