class Mail::ReceivedField

:nodoc:
atom / domain / msg-id
item-value = 1*angle-addr / addr-spec /
item-name = ALPHA *([“-”] (ALPHA / DIGIT))
name-val-pair = item-name CFWS item-value
name-val-list = [CFWS] [name-val-pair *(CFWS name-val-pair)]
received = “Received:” name-val-list “;” date-time CRLF
obs-path
path = ([CFWS] “<” ([CFWS] / addr-spec) “>” [CFWS]) /
return = “Return-Path:” path CRLF
1*received
trace = [return]

def date_time

def date_time
  @datetime ||= element.date_time
end

def do_decode

def do_decode
  if Utilities.blank?(value)
    ""
  else
    "#{info}; #{formatted_date}"
  end
end

def do_encode

def do_encode
  if Utilities.blank?(value)
    "#{name}: \r\n"
  else
    "#{name}: #{info}; #{formatted_date}\r\n"
  end
end

def element

def element
  @element ||= Mail::ReceivedElement.new(value)
end

def formatted_date

def formatted_date
  if date_time.respond_to? :strftime and date_time.respond_to? :zone
    date_time.strftime("%a, %d %b %Y %H:%M:%S ") + date_time.zone.delete(':')
  end
end

def info

def info
  element.info
end