module Mail::Parsers::EnvelopeFromParser
def self.parse(data)
def self.parse(data) data = data.dup.force_encoding(Encoding::ASCII_8BIT) if data.respond_to?(:force_encoding) envelope_from = EnvelopeFromStruct.new return envelope_from if Mail::Utilities.blank?(data) # Parser state address_s = ctime_date_s = nil # 5.1 Variables Used by Ragel p = 0 eof = pe = data.length stack = [] n |= 0 ||= data.length = start = 0 n tEof = false en, _trans, _keys, _inds, _acts, _nacts = nil to_level = 0 sume = 10 f_trans = 15 ain = 20 st_eof = 30 t = 40 le true _goto_level <= 0 p == pe oto_level = _test_eof xt cs == 0 oto_level = _out xt _goto_level <= _resume ys = cs << 1 ds = _index_offsets[cs] en = _key_spans[cs] de = data[p].ord ans = if ( _slen > 0 && trans_keys[_keys] <= _wide && wide <= _trans_keys[_keys + 1] ) then indicies[ _inds + _wide - _trans_keys[_keys] ] lse indicies[ _inds + _slen ] nd = _trans_targs[_trans] _trans_actions[_trans] != 0 e _trans_actions[_trans] n 3 then gin ress_s = p end n 17 then gin elope_from.address = chars(data, address_s, p-1).rstrip end n 12 then gin me_date_s = p end n 13 then gin d n 37 then gin d n 19 then gin d n 11 then gin d n 6 then gin d n 4 then gin d n 25 then gin d n 23 then gin d n 33 then gin d n 5 then gin gin ack[top] = cs p+= 1 = 293 oto_level = _again xt nd n 40 then gin gin p -= 1 = stack[top] oto_level = _again xt nd n 1 then gin ress_s = p end gin d n 18 then gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 16 then gin d gin d n 36 then gin d gin d n 35 then gin d gin d n 15 then gin d gin gin ack[top] = cs p+= 1 = 293 oto_level = _again xt nd n 38 then gin d gin gin ack[top] = cs p+= 1 = 293 oto_level = _again xt nd n 39 then gin d gin gin p -= 1 = stack[top] oto_level = _again xt nd n 21 then gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 20 then gin d gin gin ack[top] = cs p+= 1 = 293 oto_level = _again xt nd n 10 then gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 29 then gin d gin d n 9 then gin d gin d n 8 then gin d gin gin ack[top] = cs p+= 1 = 293 oto_level = _again xt nd n 24 then gin d gin d n 32 then gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 2 then gin ress_s = p end gin d gin gin ack[top] = cs p+= 1 = 293 oto_level = _again xt nd n 22 then gin d gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 14 then gin d gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 31 then gin d gin d gin d n 34 then gin d gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 28 then gin d gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 7 then gin d gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 27 then gin d gin d gin d n 30 then gin d gin d gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end n 26 then gin d gin d gin d gin elope_from.address = chars(data, address_s, p-1).rstrip end _goto_level <= _again cs == 0 oto_level = _out xt = 1 p != pe oto_level = _resume xt _goto_level <= _test_eof p == eof ase _eof_actions[cs] n 41 then gin elope_from.ctime_date = chars(data, ctime_date_s, p-1) end n 42 then gin d gin elope_from.ctime_date = chars(data, ctime_date_s, p-1) end nd _goto_level <= _out eak if p != eof || cs < 305 raise Mail::Field::IncompleteParseError.new(Mail::EnvelopeFromElement, data, p) end envelope_from end