Class: Mailosaur::Models::Metadata

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/Mailosaur/models/metadata.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_json

Constructor Details

#initialize(data = {}) ⇒ Metadata

Returns a new instance of Metadata.



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/Mailosaur/models/metadata.rb', line 4

def initialize(data = {})
  @headers = []
  (data['headers'] || []).each do |i| @headers << Mailosaur::Models::MessageHeader.new(i) end

  @ehlo = data['ehlo']

  @mail_from = data['mailFrom']

  @rcpt_to = []
  (data['rcptTo'] || []).each do |i| @rcpt_to << Mailosaur::Models::MessageAddress.new(i) end
end

Instance Attribute Details

#ehloString

Extended HELLO (EHLO) or HELLO (HELO) command. This value is generally used to identify the SMTP client. datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.1

Returns:

  • (String)

    The fully-qualified domain name or IP address that was provided with the



23
24
25
# File 'lib/Mailosaur/models/metadata.rb', line 23

def ehlo
  @ehlo
end

#headersArray<MessageHeader>

Returns Email headers.

Returns:



17
18
19
# File 'lib/Mailosaur/models/metadata.rb', line 17

def headers
  @headers
end

#mail_fromString

provided via the MAIL command during the SMTP transaction. datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.2

Returns:

  • (String)

    The source mailbox/email address, referred to as the ‘reverse-path’,



28
29
30
# File 'lib/Mailosaur/models/metadata.rb', line 28

def mail_from
  @mail_from
end

#rcpt_toArray<MessageAddress>

provided via the RCPT command during the SMTP transaction. datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.3

Returns:

  • (Array<MessageAddress>)

    The recipient email addresses, each referred to as a ‘forward-path’,



33
34
35
# File 'lib/Mailosaur/models/metadata.rb', line 33

def rcpt_to
  @rcpt_to
end