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

allow insecure TLS option #103

Merged
merged 1 commit into from
Apr 15, 2021
Merged

allow insecure TLS option #103

merged 1 commit into from
Apr 15, 2021

Conversation

remche
Copy link
Contributor

@remche remche commented Apr 14, 2021

This PR allow to use insecure connection for imap and tls via imap-insecure and smtp-insecure as discussed in #84.
My use case is for testing with GreenMail.

@soywod
Copy link
Member

soywod commented Apr 15, 2021

Your PR looks perfect to me! I can merge straight. Could you also update the Configuration wiki section?

@soywod soywod merged commit f4cc584 into pimalaya:master Apr 15, 2021
smtp_relay(&account.smtp_host)?
.port(account.smtp_port)
.tls(Tls::Wrapper(tls))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw this PR, but forcing Wrapper means that even when starttls is turned on, TLS will be used anyway

Copy link
Member

@soywod soywod Apr 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But STARTTLS is just a TLS extension, so maybe the .tls(...) method affects only the TLS part without interfering with STARTTLS? I guess integration tests need to be set up to catch all those tricky behaviours.

Copy link
Contributor

@paolobarbolini paolobarbolini Apr 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relay and starttls_relay methods are just convenience functions for setting the right variant of the Tls enum.

Tls::Required = We open the connection as plain and ask the server which extensions it supports. The server either supports STARTTLS and allows lettre to upgrade the initial plain text connection to TLS or we fail.
Tls::Wrapper = We open the connection directly with TLS, just like we would do with an https connection.

By doing .tls(Tls::Wrapper(tls)) you are invalidating the condition a few lines above where either TLS or STARTTLS is used based on the configuration, making lettre instead always use TLS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a Rust/TLS noob but I did not see any issue with starttls on the few tests I drove.

Copy link
Member

@soywod soywod Apr 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realized you are part of the lettre core team @paolobarbolini! Thanks for your precious help. So it means that there is no way to enable STARTTLS AND pass a custom TLS builder with dangerous_accept_* options?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it means that there is no way to enable STARTTLS AND pass a custom TLS builder with dangerous_accept_* options?

It's totally possible. The change that needs to be done is passing .tls(...) the Tls::Required(tls) variant instead of the Tls::Wrapper(tls) variant when account.smtp_starttls() is true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! @remche would you like to take care of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do asap

soywod added a commit that referenced this pull request Apr 15, 2021
@soywod soywod added cli enhancement New feature or request labels Apr 17, 2021
@soywod soywod added this to the v1.0.0 milestone Apr 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy