Module: Ronin::Network::ESMTP

Includes:
SMTP
Included in:
Net, Mixins::ESMTP, Support
Defined in:
lib/ronin/network/esmtp.rb

Overview

Provides helper methods for communicating with ESMTP services.

Constant Summary

Constant Summary

Constants included from SMTP

SMTP::DEFAULT_PORT

Instance Method Summary collapse

Methods included from SMTP

default_port, default_port=, message, #smtp_connect, #smtp_message, #smtp_send_message, #smtp_session

Instance Method Details

#esmtp_connect(host, options = {}) {|session| ... } ⇒ Net::SMTP

Creates a connection to the ESMTP server.

Options Hash (options):

  • :port (Integer) — default: SMTP.default_port

    The port to connect to.

  • :helo (String)

    The HELO domain.

  • :auth (Symbol)

    The type of authentication to use. Can be either :login, :plain, or :cram_md5.

  • :user (String)

    The user-name to authenticate with.

  • :password (String)

    The password to authenticate with.

Yields:

  • (session)

    If a block is given, it will be passed an ESMTP enabled session object.

Yield Parameters:

  • session (Net::SMTP)

    The ESMTP session.



76
77
78
79
80
81
82
# File 'lib/ronin/network/esmtp.rb', line 76

def esmtp_connect(host,options={})
  session = smtp_connect(host,options)
  session.esmtp = true

  yield session if block_given?
  return session
end

#esmtp_message(options = {}, &block) ⇒ Object

See Also:



35
36
37
# File 'lib/ronin/network/esmtp.rb', line 35

def esmtp_message(options={},&block)
  smtp_message(options,&block)
end

#esmtp_session(host, options = {}) {|session| ... } ⇒ Object

Starts an ESMTP session with the ESMTP enabled server.

Yields:

  • (session)

    If a block is given, it will be passed an ESMTP enabled session object. After the block has returned, the session will be closed.

Yield Parameters:

  • session (Net::SMTP)

    The ESMTP session.

See Also:

  • Net.esmtp_connect


104
105
106
107
108
109
110
# File 'lib/ronin/network/esmtp.rb', line 104

def esmtp_session(host,options={})
  smtp_session(host,options) do |session|
    session.esmtp = true

    yield session if block_given?
  end
end