lib/ronin/network/imap.rb in ronin-support-0.4.1 vs lib/ronin/network/imap.rb in ronin-support-0.5.0.rc1

- old
+ new

@@ -34,11 +34,11 @@ # @return [Integer] # The default Ronin IMAP port. # # @api public # - def IMAP.default_port + def self.default_port @default_port ||= DEFAULT_PORT end # # Sets the default Ronin IMAP port. @@ -46,11 +46,11 @@ # @param [Integer] port # The new default Ronin IMAP port. # # @api public # - def IMAP.default_port=(port) + def self.default_port=(port) @default_port = port end # # Creates a connection to the IMAP server. @@ -88,22 +88,23 @@ # The newly created IMAP session object. # # @api public # def imap_connect(host,options={}) - host = host.to_s - port = (options[:port] || IMAP.default_port) - certs = options[:certs] - auth = options[:auth] - user = options[:user] + host = host.to_s + port = (options[:port] || IMAP.default_port) + certs = options[:certs] + auth = options[:auth] + user = options[:user] passwd = options[:password] if options[:ssl] - ssl = true - ssl_certs = options[:ssl][:certs] + ssl = true + ssl_certs = options[:ssl][:certs] ssl_verify = SSL::VERIFY[options[:ssl][:verify]] else - ssl = false + ssl = false + ssl_certs = nil ssl_verify = false end session = Net::IMAP.new(host,port,ssl,ssl_certs,ssl_verify)