The problem with OAuth is that it’s a messy, overengineered and underdefined standard, so every implementation is a bit different. A version for generic IMAP accounts is going to be hard.
Still, maybe the community can help in part, there’s some components of the email system that are open source:
- sailfishos/buteo-sync-plugins-email
- messagingframework
- then there’s
jolla-settings-accounts-extensions-email
which AFAIK isn’t open, but it QML and XML so hackable locally.
As a reference, the venerable alpine
email program has implemented OAuth for some providers, and can be viewed here and here. There is also KDE’s kimap.
(Of course before starting any community efforts, it would be useful to know how Jolla would prefer contributions to happen…)