Add Net::POP3#enable_starttls for support STARTTLS #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
Net::POP3#enable_starttls
method supports the POP3 STARTTLS extension [RFC 2595].I believe it is valuable to offer a secure option for port 110 access because there are still many servers that support STARTTLS.
My own motivation for this feature is to ensure the correct settings for the POP servers I have set up.
I have tried to keep this PR as concise as possible.
I chose the term
starttls
instead ofstartssl
because the STLS command means STARTTLS.Net::POP3#enable_starttls
shares@ssl_params
withNet::POP3#enable_ssl
(pop3s) to reduce code changes.Its usage is the same as
Net::POP3#enable_ssl
.Net::POP3#enable_starttls
must also be called before the connection is established.Example:
Example session:
(I wish I could implement a feature where
Net::POP3#enable_starttls
can be called after the connection.However, I decided against it because
Net::POP3#start
includes the authentication process, and implementing such a feature would require more extensive code changes.)Regarding tests, I was unsure how to test TLS connections, so I only added tests for the default ports.
Thank you for maintaining this useful gem!