If you have console access, that’s done quickly:
- Remove the mail app either via occ or through the web interface.
- Go to this page and scroll down to version 3.1.1, download it.
- Unpack it in the apps/ subdirectory of your nextcloud instance: tar -xzvf [name of the file you just downloaded]
- Enable the mail app again, either via occ or the web interface.
I hope, though, that the underlying bug will be fixed in the next point release. So far, there hasn’t been a reaction to my bug report. Please have an eye on it and if needed, contribute information.