The Mail app takes a whooping 700KB. Even adding attributes, mail_daemon, libmail, add-ons and catalogs it’s still less than 3MB. That’s when expanded. The real storage is compressed. Not saying that it must stay, it could be removed from the base system and developed outside, but the space it takes is not a concern.
I have another proposal. Any one with accounts that don’t work, have a look at why and fix it. That would make it more useful and also make life better for other users.
Or: there are about 80 bugs and enhancements filed against mail related components. Some of them mention IMAP. Many of them show that mail does indeed work for some people. Take one, fix it, repeat until the count is down to 0.
And frankly, if every thing that has problems is taken out of the installation…
Now, for gmail specifically, I have just tried. Their instructions for IMAP say they don’t support passwords anymore and you have to use the “start a Goggle session” option in your client. Option that that we don’t have, of course. It seems that in fact means you have to use OAuth2 authentication, so all you need is someone to implement it.
Maybe we can use POP? They don’t say anything about starting a session with google for that. “Just” activate it in gmail settings, activate 2 factor authentication in your google account, create an app password and use that. With plain text login type, as APOP return a not supported error. Doesn’t seem to work. Well, in gmail settings it says it’s processing the change in POP state, so maybe I have to wait.
While I’m waiting… Let’s try the app password with IMAP. Wow! It works. At least for me. Removed the POP account and applied to be sure, started a draft message in the web interface, synchronized in Haiku… and yes, there it is. My only problem is that messages get duplicated (or worse) when they have labels, say a message appearing in both /Inbox and /[Gmail]/All.