Open mzhang28 opened 3 years ago
Mostly for security reasons. I'm not opposed to making this more flexible, I'll be happy to review PRs that do so.
(To be honest, I think async-imap is a more popular crate offering more functionality, but of course I'm happy if you want to use tokio-imap!)
I see, I didn't know about async-imap before but it seems to depend on async-std rather than tokio and I don't think I want to introduce async-std into my project. I may take a peek into how their Client works and incorporate it into my project and if it works well then I'll make a PR. Thanks for your reply!
Yeah, it does depend on async-std -- I somehow thought it was more runtime-agnostic, but that seems to be stuck:
(Happy to review PRs to extend the Client
API, too.)
async-imap at this point works with async-std and tokio and does not even setup connections itself. You setup a connection and give it to async-imap.
STARTTLS implementations serve over unencrypted TCP and then performs a TLS handshake to "upgrade" the connection rather than starting from scratch. Additionally, unencrypted IMAP connections are sometimes desired (localhost?) and doesn't seem to be supported either.
Since Client is genericized over the actual TCP stream type, could it also just expose a constructor that doesn't necessarily construct a TlsClient?