Module: Ronin::Network::POP3
- Included in:
- Net, Mixins::POP3, Support
- Defined in:
- lib/ronin/network/pop3.rb
Overview
Provides helper methods for communicating with POP3 services.
Constant Summary collapse
- DEFAULT_PORT =
Default POP3 port
110
Class Method Summary collapse
-
.default_port ⇒ Integer
The default Ronin POP3 port.
-
.default_port=(port) ⇒ Object
Sets the default Ronin POP3 port.
Instance Method Summary collapse
-
#pop3_connect(host, options = {}) {|session| ... } ⇒ Net::POP3
Creates a connection to the POP3 server.
-
#pop3_session(host, options = {}) {|session| ... } ⇒ nil
Starts a session with the POP3 server.
Class Method Details
.default_port ⇒ Integer
Returns The default Ronin POP3 port.
37 38 39 |
# File 'lib/ronin/network/pop3.rb', line 37 def self.default_port @default_port ||= DEFAULT_PORT end |
.default_port=(port) ⇒ Object
Sets the default Ronin POP3 port.
49 50 51 |
# File 'lib/ronin/network/pop3.rb', line 49 def self.default_port=(port) @default_port = port end |
Instance Method Details
#pop3_connect(host, options = {}) {|session| ... } ⇒ Net::POP3
Creates a connection to the POP3 server.
82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/ronin/network/pop3.rb', line 82 def pop3_connect(host,={}) host = host.to_s port = ([:port] || POP3.default_port) user = [:user] password = [:password] session = Net::POP3.start(host,port,user,password) yield session if block_given? return session end |
#pop3_session(host, options = {}) {|session| ... } ⇒ nil
Starts a session with the POP3 server.
114 115 116 117 118 119 120 121 |
# File 'lib/ronin/network/pop3.rb', line 114 def pop3_session(host,={}) session = pop3_connect(host,) yield session if block_given? session.finish return nil end |