This one might be exactly what you're looking for, in case you can authenticate by username/password only to your IMAP provider:
https://gitlab.com/axet/android-sms-gate
(available via f-droid too)
I'm using it on a secondary (stock Google Android) phone in the admin profile as default SMS app, while nothing else happens in the admin profile. All the apps in use are on a secondary profile, which wasn't granted phone/SMS access.
That way, any incoming SMS gets copied into the configured IMAP folder and never reaches whatever SMS app is running in the other profile(s).
Easy possibility to have SMS-TANs e.g. available at independent locations of your phone - you can access it in your IMAP (sub-)folder wherever you are, while your phone stays wherever you want it to be :-)