Module: Ronin::Network::Mixins::ESMTP
Overview
Adds ESMTP convenience methods and connection parameters to a class.
Defines the following parameters:
host
(String
) - ESMTP host.port
(Integer
) - ESMTP port.esmtp_login
(String
) - ESMTP authentication method to use.esmtp_user
(String
) - ESMTP user to login as.esmtp_password
(String
) - ESMTP password to login with.
Constant Summary
Constants included from SMTP
Class Method Summary collapse
-
.esmtp_login ⇒ Object
ESMTP authentication method to use.
-
.esmtp_login=(value) ⇒ Object
ESMTP authentication method to use.
-
.esmtp_password ⇒ Object
ESMTP password to login with.
-
.esmtp_password=(value) ⇒ Object
ESMTP password to login with.
-
.esmtp_user ⇒ Object
ESMTP user to login as.
-
.esmtp_user=(value) ⇒ Object
ESMTP user to login as.
-
.host ⇒ Object
ESMTP host.
-
.host=(value) ⇒ Object
ESMTP host.
-
.port ⇒ Object
ESMTP port.
-
.port=(value) ⇒ Object
ESMTP port.
Instance Method Summary collapse
-
#esmtp_connect(options = {}) {|session| ... } ⇒ Net::SMTP
protected
Creates a connection to the ESMTP server.
-
#esmtp_login ⇒ Object
ESMTP authentication method to use.
-
#esmtp_login=(value) ⇒ Object
ESMTP authentication method to use.
-
#esmtp_password ⇒ Object
ESMTP password to login with.
-
#esmtp_password=(value) ⇒ Object
ESMTP password to login with.
-
#esmtp_session(options = {}) {|session| ... } ⇒ Object
protected
Starts a session with the ESMTP server.
-
#esmtp_user ⇒ Object
ESMTP user to login as.
-
#esmtp_user=(value) ⇒ Object
ESMTP user to login as.
-
#host ⇒ Object
ESMTP host.
-
#host=(value) ⇒ Object
ESMTP host.
-
#port ⇒ Object
ESMTP port.
-
#port=(value) ⇒ Object
ESMTP port.
Methods included from Mixin
Methods included from ESMTP
Methods included from SMTP
default_port, default_port=, message, #smtp_connect, #smtp_message, #smtp_send_message, #smtp_session
Class Method Details
.esmtp_login ⇒ Object
ESMTP authentication method to use
49 50 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 49 parameter :esmtp_login, :type => String, :description => 'ESMTP authentication method to use' |
.esmtp_login=(value) ⇒ Object
ESMTP authentication method to use
49 50 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 49 parameter :esmtp_login, :type => String, :description => 'ESMTP authentication method to use' |
.esmtp_password ⇒ Object
ESMTP password to login with
57 58 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 57 parameter :esmtp_password, :type => String, :description => 'ESMTP password to login with' |
.esmtp_password=(value) ⇒ Object
ESMTP password to login with
57 58 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 57 parameter :esmtp_password, :type => String, :description => 'ESMTP password to login with' |
.esmtp_user ⇒ Object
ESMTP user to login as
53 54 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 53 parameter :esmtp_user, :type => String, :description => 'ESMTP user to login as' |
.esmtp_user=(value) ⇒ Object
ESMTP user to login as
53 54 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 53 parameter :esmtp_user, :type => String, :description => 'ESMTP user to login as' |
.host ⇒ Object
ESMTP host
41 42 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 41 parameter :host, :type => String, :description => 'ESMTP host' |
.host=(value) ⇒ Object
ESMTP host
41 42 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 41 parameter :host, :type => String, :description => 'ESMTP host' |
Instance Method Details
#esmtp_connect(options = {}) {|session| ... } ⇒ Net::SMTP (protected)
Creates a connection to the ESMTP server. The host
, port
,
esmtp_login
, esmtp_user
and esmtp_password
parameters
will also be used to connect to the ESMTP server.
100 101 102 103 104 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 100 def esmtp_connect(={},&block) print_info "Connecting to #{host_port} ..." return super(self.host,(),&block) end |
#esmtp_login ⇒ Object
ESMTP authentication method to use
49 50 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 49 parameter :esmtp_login, :type => String, :description => 'ESMTP authentication method to use' |
#esmtp_login=(value) ⇒ Object
ESMTP authentication method to use
49 50 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 49 parameter :esmtp_login, :type => String, :description => 'ESMTP authentication method to use' |
#esmtp_password ⇒ Object
ESMTP password to login with
57 58 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 57 parameter :esmtp_password, :type => String, :description => 'ESMTP password to login with' |
#esmtp_password=(value) ⇒ Object
ESMTP password to login with
57 58 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 57 parameter :esmtp_password, :type => String, :description => 'ESMTP password to login with' |
#esmtp_session(options = {}) {|session| ... } ⇒ Object (protected)
Starts a session with the ESMTP server. The host
, port
,
esmtp_login
, esmtp_user
and esmtp_password
parameters
will also be used to connect to the ESMTP server.
126 127 128 129 130 131 132 133 134 135 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 126 def esmtp_session(={}) super(()) do |sess| yield sess if block_given? print_info "Logging out ..." end print_info "Disconnected from #{host_port}" return nil end |
#esmtp_user ⇒ Object
ESMTP user to login as
53 54 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 53 parameter :esmtp_user, :type => String, :description => 'ESMTP user to login as' |
#esmtp_user=(value) ⇒ Object
ESMTP user to login as
53 54 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 53 parameter :esmtp_user, :type => String, :description => 'ESMTP user to login as' |
#host ⇒ Object
ESMTP host
41 42 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 41 parameter :host, :type => String, :description => 'ESMTP host' |
#host=(value) ⇒ Object
ESMTP host
41 42 |
# File 'lib/ronin/network/mixins/esmtp.rb', line 41 parameter :host, :type => String, :description => 'ESMTP host' |