class FMail

Attributes

received[R]

Public Class Methods

new(mail_text) click to toggle source
# File lib/email.rb, line 31
def initialize(mail_text)
  @log = @@log
  if !mail_text || mail_text.empty?
    @log.error('No mail-text provided. Aborting!')
    exit false
  end
  @mail_text = mail_text
  # @log.debug('mail text is ' << @mail_text)
  extr_received
end

Private Instance Methods

extr_received() click to toggle source
# File lib/email.rb, line 46
def extr_received
  @mail = Mail::read_from_string(@mail_text)
  headers = @mail.header_fields
  @received = headers.filter{|h| h.name == 'Received'}.collect{|h| h.unparsed_value}
  @log.debug("found received-headers: " << @received.to_s)
end