Edit: New version 0.0.4 available, see topic: https://forum.openoffice.org/en/forum/viewtopic.php?f=47&t=89140#p425774
This extension is available at the following address:
https://github.com/prrvchr/gMailOOo/releases/download/v0.0.2/gMailOOo.oxt
The OAuth2.0 protocol allows the connection to the SMTP mail server of Google, after acceptance of the connection authorization, by exchange of tokens.
The revocation takes place in the management of "Application associated with your account":
https://myaccount.google.com/security?utm_source=OGB#connectedapps
No more password is stored in LibreOffice.

The documentation is available at:
https://github.com/prrvchr/gMailOOo
Edit:
This extension is not compatible with OpenOffice (embedded Python version problem) in any case as long as OpenOffice does not support Python >= 3.
And I am looking for help to test on Mac...