diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-21 06:34:03 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-21 06:34:03 +0000 |
commit | ad89f7e6d2abe4fb96e713cf94b90c9781afc31d (patch) | |
tree | 107e78f0a40f1a9673812a7177f7e240bd3b917f /lib | |
parent | 1ee46d76c49c2ddb72f1bb0539decc165b48feb7 (diff) | |
download | ruby-ad89f7e6d2abe4fb96e713cf94b90c9781afc31d.tar.gz |
* lib/net/imap.rb (initialize): accept service name. changed
the defalut value of the old style +verify+ argument to true.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/imap.rb | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb index ad47872501..688ab2ff49 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -330,7 +330,7 @@ module Net end # Sends a STARTTLS command to start TLS session. - def starttls(options = {}, verify = false) + def starttls(options = {}, verify = true) send_command("STARTTLS") do |resp| if resp.kind_of?(TaggedResponse) && resp.name == "OK" begin @@ -909,20 +909,18 @@ module Net # Net::IMAP::ByeResponseError:: we connected to the host, but they # immediately said goodbye to us. def initialize(host, port_or_options = {}, - usessl = false, certs = nil, verify = false) + usessl = false, certs = nil, verify = true) super() @host = host begin + options = port_or_options.to_hash + rescue NoMethodError # for backward compatibility - port = port_or_options.to_int - options = { - :port => port - } + options = {} + options[:port] = port_or_options if usessl options[:ssl] = create_ssl_params(certs, verify) end - rescue NoMethodError - options = port_or_options end @port = options[:port] || (options[:ssl] ? SSL_PORT : PORT) @tag_prefix = "RUBY" @@ -1240,7 +1238,7 @@ module Net end end - def create_ssl_params(certs = nil, verify = false) + def create_ssl_params(certs = nil, verify = true) params = {} if certs if File.file?(certs) |