A HTTP API for IMAP and for that matter, POP3 and SMTP is exactly what we built where I work.
For anyone wonder why build such a thing? A simplified interface is an exceptionally powerful tool. Many of our clients have encountered issues constructing multipart http requests so if that’s an issue, good luck getting IMAP to work. Since multipart turns out to be such an issue we’ve turned out support for a variety of uploads including (completely non-standard) where the request body is just the file content.
We’ve built our API in Java and as such have simply used the JavaMail API. Admittedly though the plan is to get off this design since when there’s 10s of thousands messages in an IMAP maildir folder the index can grow to an unmanageable size.