-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Conversation
Your PR looks perfect to me! I can merge straight. Could you also update the Configuration wiki section? |
smtp_relay(&account.smtp_host)? | ||
.port(account.smtp_port) | ||
.tls(Tls::Wrapper(tls)) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 withdangerous_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
.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do asap
This PR allow to use insecure connection for imap and tls via
imap-insecure
andsmtp-insecure
as discussed in #84.My use case is for testing with GreenMail.