Skip to content

add option to enable starttls for imap retriever#723

Closed
doits wants to merge 2 commits into
mikel:masterfrom
doits:add_starttls_imap
Closed

add option to enable starttls for imap retriever#723
doits wants to merge 2 commits into
mikel:masterfrom
doits:add_starttls_imap

Conversation

@doits

@doits doits commented Jun 5, 2014

Copy link
Copy Markdown
Contributor

Anything else you need for a merge? Are there some docs or tests to update? Please point me to them and I'll do it if required.

@bf4

bf4 commented Jun 7, 2014

Copy link
Copy Markdown
Contributor

spec/mail/network/retriever_methods/imap_spec.rb looks like the right place for the specs.

What's your use-case for this?

@doits

doits commented Jun 10, 2014

Copy link
Copy Markdown
Contributor Author

I was unable to connect to my IMAP-Server without using starttls. I always received the error message OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol when using the enable_ssl-option. Only with starttls enabled, connection works.

Regarding the tests: How should it be tested? I don't see any test for the enable_ssl-option, either. Can you give me a hint in the right direction for a test?

@krisdigital

Copy link
Copy Markdown

Until this option is merged, chances are that you can use imaps via port 993, then no STARTTLS is needed.

http://wiki.dovecot.org/SSL:

Originally SSL support was added to protocols by giving them a separate "SSL port" (imaps, pop3s, etc.), where the SSL handshake starts immediately when client connects, and only after the session is encrypted the regular protocol handling begins. Using two separate ports for plaintext and SSL connections was thought to be wasteful and adds complexity for clients which may wish to make use of SSL when it is advertised, so STARTTLS command was added and intended to deprecate the SSL ports. Clients using STARTTLS work by connecting to the regular unencrypted port and immediately issue a STARTTLS command, after which the session is encrypted. After SSL handshake there is no difference between SSL port initiated connections and STARTTLS initiated connections.

retriever_method :imap, :address    => "mail.your-mail-server",
                              :user_name  => 'your user name',
                              :password   => '***************',
                              :enable_ssl => true,
                              :port => 993

@jeremy jeremy closed this in 61a49d2 May 22, 2017
@jeremy jeremy added this to the 2.7.0 milestone May 22, 2017
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

Successfully merging this pull request may close these issues.

4 participants