Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is Client's public API so restrictive? (i.e hardcoded port, unable to opt out of TLS, etc) #112

Open
mzhang28 opened this issue Feb 12, 2021 · 5 comments

Comments

@mzhang28
Copy link

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?

@djc
Copy link
Owner

djc commented Feb 15, 2021

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!)

@mzhang28
Copy link
Author

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!

@djc
Copy link
Owner

djc commented Feb 15, 2021

Yeah, it does depend on async-std -- I somehow thought it was more runtime-agnostic, but that seems to be stuck:

async-email/async-imap#21

@djc
Copy link
Owner

djc commented Feb 15, 2021

(Happy to review PRs to extend the Client API, too.)

@link2xt
Copy link
Contributor

link2xt commented Jan 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants