# File lib/action_mailer/vendor/tmail-1.2.3/tmail/header.rb, line 77 def new_from_port( port, name, conf = DEFAULT_CONFIG ) if name == "EnvelopeSender" name = "From" re = Regexp.new('\A(From) ', 'i') else re = Regexp.new('\A(' + Regexp.quote(name) + '):', 'i') end str = nil port.ropen {|f| f.each do |line| if m = re.match(line) then str = m.post_match.strip elsif str and /\A[\t ]/ === line then str << ' ' << line.strip elsif /\A-*\s*\z/ === line then break elsif str then break end end } new(name, str, Config.to_config(conf)) if str end