new(host, port = PORT, usessl = false, certs = nil, verify = false) public

Creates a new Net::IMAP object and connects it to the specified port (143 by default) on the named host. If usessl is true, then an attempt will be made to use SSL (now TLS) to connect to the server. For this to work OpenSSL [OSSL] and the Ruby OpenSSL [RSSL] extensions need to be installed. The certs parameter indicates the path or file containing the CA cert of the server, and the verify parameter is for the OpenSSL verification callback.

The most common errors are:


connection refused by host or an intervening firewall.


connection timed out (possibly due to packets being dropped by an intervening firewall).


there is no route to that network.


hostname not known or other socket error.


we connected to the host, but they immediately said goodbye to us.

Show source
Register or log in to add new notes.