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
- DEFAULT_PORT =
Default POP3 port
110
Class Method Summary (collapse)
-
+ (Integer) default_port
The default Ronin POP3 port.
-
+ (Object) default_port=(port)
Sets the default Ronin POP3 port.
Instance Method Summary (collapse)
-
- (Net::POP3) pop3_connect(host, options = {}) {|session| ... }
Creates a connection to the POP3 server.
-
- (nil) pop3_session(host, options = {}) {|session| ... }
Starts a session with the POP3 server.
Class Method Details
+ (Integer) default_port
The default Ronin POP3 port.
37 38 39 |
# File 'lib/ronin/network/pop3.rb', line 37 def POP3.default_port @default_port ||= DEFAULT_PORT end |
+ (Object) default_port=(port)
Sets the default Ronin POP3 port.
49 50 51 |
# File 'lib/ronin/network/pop3.rb', line 49 def POP3.default_port=(port) @default_port = port end |
Instance Method Details
- (Net::POP3) pop3_connect(host, options = {}) {|session| ... }
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 |
- (nil) pop3_session(host, options = {}) {|session| ... }
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 |