Class: PhisherPhinder::Mail
- Inherits:
-
Object
- Object
- PhisherPhinder::Mail
- Defined in:
- lib/phisher_phinder/mail.rb
Instance Attribute Summary collapse
-
#authentication_headers ⇒ Object
readonly
Returns the value of attribute authentication_headers.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#original_body ⇒ Object
readonly
Returns the value of attribute original_body.
-
#original_email ⇒ Object
readonly
Returns the value of attribute original_email.
-
#original_headers ⇒ Object
readonly
Returns the value of attribute original_headers.
-
#tracing_headers ⇒ Object
readonly
Returns the value of attribute tracing_headers.
Instance Method Summary collapse
- #hypertext_links ⇒ Object
-
#initialize(original_email:, original_headers:, original_body:, headers:, tracing_headers:, body:, authentication_headers:) ⇒ Mail
constructor
A new instance of Mail.
- #reply_to_addresses ⇒ Object
Constructor Details
#initialize(original_email:, original_headers:, original_body:, headers:, tracing_headers:, body:, authentication_headers:) ⇒ Mail
Returns a new instance of Mail.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/phisher_phinder/mail.rb', line 13 def initialize( original_email:, original_headers:, original_body:, headers:, tracing_headers:, body:, authentication_headers: ) @original_email = original_email @original_headers = original_headers @original_body = original_body @headers = headers @tracing_headers = tracing_headers @authentication_headers = authentication_headers @body = body end |
Instance Attribute Details
#authentication_headers ⇒ Object (readonly)
Returns the value of attribute authentication_headers.
5 6 7 |
# File 'lib/phisher_phinder/mail.rb', line 5 def authentication_headers @authentication_headers end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/phisher_phinder/mail.rb', line 5 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/phisher_phinder/mail.rb', line 5 def headers @headers end |
#original_body ⇒ Object (readonly)
Returns the value of attribute original_body.
5 6 7 |
# File 'lib/phisher_phinder/mail.rb', line 5 def original_body @original_body end |
#original_email ⇒ Object (readonly)
Returns the value of attribute original_email.
5 6 7 |
# File 'lib/phisher_phinder/mail.rb', line 5 def original_email @original_email end |
#original_headers ⇒ Object (readonly)
Returns the value of attribute original_headers.
5 6 7 |
# File 'lib/phisher_phinder/mail.rb', line 5 def original_headers @original_headers end |
#tracing_headers ⇒ Object (readonly)
Returns the value of attribute tracing_headers.
5 6 7 |
# File 'lib/phisher_phinder/mail.rb', line 5 def tracing_headers @tracing_headers end |
Instance Method Details
#hypertext_links ⇒ Object
33 34 35 36 37 38 |
# File 'lib/phisher_phinder/mail.rb', line 33 def hypertext_links body_as_html. xpath('//a'). select { |el| el.attributes['href'] }. map { |el| BodyHyperlink.new(el.attributes['href'].value, el.text) } end |
#reply_to_addresses ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/phisher_phinder/mail.rb', line 25 def reply_to_addresses (@headers[:reply_to] || []).map do |value_string| value_string.split(",") end.flatten.map do |email_address_string| extract_email_address(email_address_string) end.uniq end |