Class: Rex::Proto::Sms::Model::Smtp

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/proto/sms/model/smtp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Rex::Proto::Sms::Model::Smtp

Initializes the SMTP object.

Parameters:

  • opts (Hash) (defaults to: {})

Options Hash (opts):

  • :address (String)
  • :port (Fixnum)
  • :username (String)
  • :password (String)
  • :helo_domain (String)
  • :login_type (Symbol)
  • :from (String)


48
49
50
51
52
53
54
55
56
# File 'lib/rex/proto/sms/model/smtp.rb', line 48

def initialize(opts={})
  self.address     = opts[:address]
  self.port        = opts[:port]        || 25
  self.username    = opts[:username]
  self.password    = opts[:password]
  self.helo_domain = opts[:helo_domain] || 'localhost'
  self.  = opts[:login_type]  || :login
  self.from        = opts[:from]        || ''
end

Instance Attribute Details

#addressString

Returns SMTP address.

Returns:

  • (String)

    SMTP address



9
10
11
# File 'lib/rex/proto/sms/model/smtp.rb', line 9

def address
  @address
end

#fromString

Returns Sender.

Returns:

  • (String)

    Sender



29
30
31
# File 'lib/rex/proto/sms/model/smtp.rb', line 29

def from
  @from
end

#helo_domainString

Returns The domain to use for the HELO SMTP message.

Returns:

  • (String)

    The domain to use for the HELO SMTP message



33
34
35
# File 'lib/rex/proto/sms/model/smtp.rb', line 33

def helo_domain
  @helo_domain
end

#login_typeSymbol

Returns SMTP login type (:login, :plain, and :cram_md5).

Returns:

  • (Symbol)

    SMTP login type (:login, :plain, and :cram_md5)



25
26
27
# File 'lib/rex/proto/sms/model/smtp.rb', line 25

def 
  @login_type
end

#passwordString

Returns SMTP password.

Returns:

  • (String)

    SMTP password



21
22
23
# File 'lib/rex/proto/sms/model/smtp.rb', line 21

def password
  @password
end

#portFixnum

Returns SMTP port.

Returns:

  • (Fixnum)

    SMTP port



13
14
15
# File 'lib/rex/proto/sms/model/smtp.rb', line 13

def port
  @port
end

#usernameString

Returns SMTP account/username.

Returns:

  • (String)

    SMTP account/username



17
18
19
# File 'lib/rex/proto/sms/model/smtp.rb', line 17

def username
  @username
end