Class: Mailosaur::Models::Metadata
- Defined in:
- lib/Mailosaur/models/metadata.rb
Instance Attribute Summary collapse
-
#ehlo ⇒ String
Extended HELLO (EHLO) or HELLO (HELO) command.
-
#headers ⇒ Array<MessageHeader>
Email headers.
-
#mail_from ⇒ String
provided via the MAIL command during the SMTP transaction.
-
#rcpt_to ⇒ Array<MessageAddress>
provided via the RCPT command during the SMTP transaction.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ Metadata
constructor
A new instance of Metadata.
Methods inherited from BaseModel
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
#ehlo ⇒ String
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
23 24 25 |
# File 'lib/Mailosaur/models/metadata.rb', line 23 def ehlo @ehlo end |
#headers ⇒ Array<MessageHeader>
Returns Email headers.
17 18 19 |
# File 'lib/Mailosaur/models/metadata.rb', line 17 def headers @headers end |
#mail_from ⇒ String
provided via the MAIL command during the SMTP transaction. datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.2
28 29 30 |
# File 'lib/Mailosaur/models/metadata.rb', line 28 def mail_from @mail_from end |
#rcpt_to ⇒ Array<MessageAddress>
provided via the RCPT command during the SMTP transaction. datatracker.ietf.org/doc/html/rfc5321#section-4.1.1.3
33 34 35 |
# File 'lib/Mailosaur/models/metadata.rb', line 33 def rcpt_to @rcpt_to end |