mail 2.6.1 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +150 -107
  4. data/lib/mail/attachments_list.rb +13 -10
  5. data/lib/mail/body.rb +104 -90
  6. data/lib/mail/check_delivery_params.rb +55 -10
  7. data/lib/mail/configuration.rb +3 -0
  8. data/lib/mail/constants.rb +79 -0
  9. data/lib/mail/elements/address.rb +96 -108
  10. data/lib/mail/elements/address_list.rb +13 -30
  11. data/lib/mail/elements/content_disposition_element.rb +10 -16
  12. data/lib/mail/elements/content_location_element.rb +9 -13
  13. data/lib/mail/elements/content_transfer_encoding_element.rb +7 -11
  14. data/lib/mail/elements/content_type_element.rb +17 -23
  15. data/lib/mail/elements/date_time_element.rb +8 -15
  16. data/lib/mail/elements/envelope_from_element.rb +23 -23
  17. data/lib/mail/elements/message_ids_element.rb +22 -15
  18. data/lib/mail/elements/mime_version_element.rb +8 -15
  19. data/lib/mail/elements/phrase_list.rb +13 -10
  20. data/lib/mail/elements/received_element.rb +28 -19
  21. data/lib/mail/elements.rb +1 -0
  22. data/lib/mail/encodings/7bit.rb +10 -14
  23. data/lib/mail/encodings/8bit.rb +5 -18
  24. data/lib/mail/encodings/base64.rb +15 -10
  25. data/lib/mail/encodings/binary.rb +4 -22
  26. data/lib/mail/encodings/identity.rb +24 -0
  27. data/lib/mail/encodings/quoted_printable.rb +13 -7
  28. data/lib/mail/encodings/transfer_encoding.rb +47 -28
  29. data/lib/mail/encodings/unix_to_unix.rb +20 -0
  30. data/lib/mail/encodings.rb +102 -92
  31. data/lib/mail/envelope.rb +12 -14
  32. data/lib/mail/field.rb +121 -85
  33. data/lib/mail/field_list.rb +62 -8
  34. data/lib/mail/fields/bcc_field.rb +42 -48
  35. data/lib/mail/fields/cc_field.rb +29 -50
  36. data/lib/mail/fields/comments_field.rb +28 -37
  37. data/lib/mail/fields/common_address_field.rb +170 -0
  38. data/lib/mail/fields/common_date_field.rb +58 -0
  39. data/lib/mail/fields/common_field.rb +77 -0
  40. data/lib/mail/fields/common_message_id_field.rb +42 -0
  41. data/lib/mail/fields/content_description_field.rb +8 -14
  42. data/lib/mail/fields/content_disposition_field.rb +20 -44
  43. data/lib/mail/fields/content_id_field.rb +25 -51
  44. data/lib/mail/fields/content_location_field.rb +12 -25
  45. data/lib/mail/fields/content_transfer_encoding_field.rb +32 -31
  46. data/lib/mail/fields/content_type_field.rb +51 -80
  47. data/lib/mail/fields/date_field.rb +24 -52
  48. data/lib/mail/fields/from_field.rb +29 -50
  49. data/lib/mail/fields/in_reply_to_field.rb +39 -49
  50. data/lib/mail/fields/keywords_field.rb +19 -32
  51. data/lib/mail/fields/message_id_field.rb +26 -71
  52. data/lib/mail/fields/mime_version_field.rb +20 -30
  53. data/lib/mail/fields/named_structured_field.rb +11 -0
  54. data/lib/mail/fields/named_unstructured_field.rb +11 -0
  55. data/lib/mail/fields/optional_field.rb +10 -7
  56. data/lib/mail/fields/{common/parameter_hash.rb → parameter_hash.rb} +16 -13
  57. data/lib/mail/fields/received_field.rb +44 -57
  58. data/lib/mail/fields/references_field.rb +36 -49
  59. data/lib/mail/fields/reply_to_field.rb +29 -50
  60. data/lib/mail/fields/resent_bcc_field.rb +29 -50
  61. data/lib/mail/fields/resent_cc_field.rb +29 -50
  62. data/lib/mail/fields/resent_date_field.rb +6 -30
  63. data/lib/mail/fields/resent_from_field.rb +29 -50
  64. data/lib/mail/fields/resent_message_id_field.rb +6 -29
  65. data/lib/mail/fields/resent_sender_field.rb +28 -57
  66. data/lib/mail/fields/resent_to_field.rb +29 -50
  67. data/lib/mail/fields/return_path_field.rb +51 -55
  68. data/lib/mail/fields/sender_field.rb +35 -56
  69. data/lib/mail/fields/structured_field.rb +4 -30
  70. data/lib/mail/fields/subject_field.rb +10 -11
  71. data/lib/mail/fields/to_field.rb +29 -50
  72. data/lib/mail/fields/unstructured_field.rb +36 -50
  73. data/lib/mail/fields.rb +1 -0
  74. data/lib/mail/header.rb +73 -110
  75. data/lib/mail/indifferent_hash.rb +1 -0
  76. data/lib/mail/mail.rb +6 -11
  77. data/lib/mail/matchers/attachment_matchers.rb +44 -0
  78. data/lib/mail/matchers/has_sent_mail.rb +53 -9
  79. data/lib/mail/message.rb +132 -136
  80. data/lib/mail/multibyte/chars.rb +24 -180
  81. data/lib/mail/multibyte/unicode.rb +31 -26
  82. data/lib/mail/multibyte/utils.rb +27 -43
  83. data/lib/mail/multibyte.rb +56 -16
  84. data/lib/mail/network/delivery_methods/exim.rb +9 -11
  85. data/lib/mail/network/delivery_methods/file_delivery.rb +14 -16
  86. data/lib/mail/network/delivery_methods/logger_delivery.rb +34 -0
  87. data/lib/mail/network/delivery_methods/sendmail.rb +68 -24
  88. data/lib/mail/network/delivery_methods/smtp.rb +77 -54
  89. data/lib/mail/network/delivery_methods/smtp_connection.rb +5 -9
  90. data/lib/mail/network/delivery_methods/test_mailer.rb +9 -9
  91. data/lib/mail/network/retriever_methods/base.rb +9 -8
  92. data/lib/mail/network/retriever_methods/imap.rb +21 -7
  93. data/lib/mail/network/retriever_methods/pop3.rb +6 -3
  94. data/lib/mail/network/retriever_methods/test_retriever.rb +4 -2
  95. data/lib/mail/network.rb +2 -0
  96. data/lib/mail/parser_tools.rb +15 -0
  97. data/lib/mail/parsers/address_lists_parser.rb +33226 -116
  98. data/lib/mail/parsers/address_lists_parser.rl +179 -0
  99. data/lib/mail/parsers/content_disposition_parser.rb +883 -49
  100. data/lib/mail/parsers/content_disposition_parser.rl +89 -0
  101. data/lib/mail/parsers/content_location_parser.rb +810 -23
  102. data/lib/mail/parsers/content_location_parser.rl +78 -0
  103. data/lib/mail/parsers/content_transfer_encoding_parser.rb +510 -21
  104. data/lib/mail/parsers/content_transfer_encoding_parser.rl +71 -0
  105. data/lib/mail/parsers/content_type_parser.rb +1031 -47
  106. data/lib/mail/parsers/content_type_parser.rl +90 -0
  107. data/lib/mail/parsers/date_time_parser.rb +879 -24
  108. data/lib/mail/parsers/date_time_parser.rl +69 -0
  109. data/lib/mail/parsers/envelope_from_parser.rb +3670 -40
  110. data/lib/mail/parsers/envelope_from_parser.rl +89 -0
  111. data/lib/mail/parsers/message_ids_parser.rb +5147 -25
  112. data/lib/mail/parsers/message_ids_parser.rl +93 -0
  113. data/lib/mail/parsers/mime_version_parser.rb +498 -26
  114. data/lib/mail/parsers/mime_version_parser.rl +68 -0
  115. data/lib/mail/parsers/phrase_lists_parser.rb +872 -21
  116. data/lib/mail/parsers/phrase_lists_parser.rl +90 -0
  117. data/lib/mail/parsers/received_parser.rb +8777 -42
  118. data/lib/mail/parsers/received_parser.rl +91 -0
  119. data/lib/mail/parsers/rfc2045_content_transfer_encoding.rl +13 -0
  120. data/lib/mail/parsers/rfc2045_content_type.rl +25 -0
  121. data/lib/mail/parsers/rfc2045_mime.rl +16 -0
  122. data/lib/mail/parsers/rfc2183_content_disposition.rl +15 -0
  123. data/lib/mail/parsers/rfc3629_utf8.rl +19 -0
  124. data/lib/mail/parsers/rfc5234_abnf_core_rules.rl +22 -0
  125. data/lib/mail/parsers/rfc5322.rl +74 -0
  126. data/lib/mail/parsers/rfc5322_address.rl +72 -0
  127. data/lib/mail/parsers/{ragel/date_time.rl → rfc5322_date_time.rl} +8 -1
  128. data/lib/mail/parsers/rfc5322_lexical_tokens.rl +60 -0
  129. data/lib/mail/parsers.rb +12 -25
  130. data/lib/mail/part.rb +11 -12
  131. data/lib/mail/parts_list.rb +88 -14
  132. data/lib/mail/smtp_envelope.rb +57 -0
  133. data/lib/mail/utilities.rb +377 -40
  134. data/lib/mail/values/unicode_tables.dat +0 -0
  135. data/lib/mail/version.rb +8 -15
  136. data/lib/mail/yaml.rb +30 -0
  137. data/lib/mail.rb +9 -32
  138. metadata +138 -94
  139. data/CHANGELOG.rdoc +0 -752
  140. data/CONTRIBUTING.md +0 -60
  141. data/Dependencies.txt +0 -2
  142. data/Gemfile +0 -15
  143. data/Rakefile +0 -29
  144. data/TODO.rdoc +0 -9
  145. data/VERSION +0 -4
  146. data/lib/mail/core_extensions/nil.rb +0 -19
  147. data/lib/mail/core_extensions/object.rb +0 -13
  148. data/lib/mail/core_extensions/smtp.rb +0 -24
  149. data/lib/mail/core_extensions/string/access.rb +0 -145
  150. data/lib/mail/core_extensions/string/multibyte.rb +0 -78
  151. data/lib/mail/core_extensions/string.rb +0 -43
  152. data/lib/mail/fields/common/address_container.rb +0 -16
  153. data/lib/mail/fields/common/common_address.rb +0 -135
  154. data/lib/mail/fields/common/common_date.rb +0 -35
  155. data/lib/mail/fields/common/common_field.rb +0 -57
  156. data/lib/mail/fields/common/common_message_id.rb +0 -48
  157. data/lib/mail/multibyte/exceptions.rb +0 -8
  158. data/lib/mail/parsers/ragel/common.rl +0 -184
  159. data/lib/mail/parsers/ragel/parser_info.rb +0 -61
  160. data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb +0 -14864
  161. data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb.rl +0 -37
  162. data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb +0 -751
  163. data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb.rl +0 -37
  164. data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb +0 -614
  165. data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl +0 -37
  166. data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb +0 -447
  167. data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl +0 -37
  168. data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb +0 -825
  169. data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb.rl +0 -37
  170. data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb +0 -817
  171. data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb.rl +0 -37
  172. data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb +0 -2129
  173. data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb.rl +0 -37
  174. data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb +0 -1570
  175. data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb.rl +0 -37
  176. data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb +0 -440
  177. data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb.rl +0 -37
  178. data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb +0 -564
  179. data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl +0 -37
  180. data/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl +0 -51
  181. data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb +0 -5144
  182. data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb.rl +0 -37
  183. data/lib/mail/parsers/ragel/ruby/parser.rb.rl.erb +0 -37
  184. data/lib/mail/parsers/ragel/ruby.rb +0 -39
  185. data/lib/mail/parsers/ragel.rb +0 -17
  186. data/lib/mail/patterns.rb +0 -37
  187. data/lib/mail/version_specific/ruby_1_8.rb +0 -119
  188. data/lib/mail/version_specific/ruby_1_9.rb +0 -159
@@ -1,37 +0,0 @@
1
- %%{
2
- machine content_disposition;
3
-
4
- include rb_actions "rb_actions.rl";
5
- include common "../../common.rl";
6
-
7
- getkey data_unpacked[p];
8
-
9
- main := content_disposition;
10
- }%%
11
-
12
- module Mail
13
- module Parsers
14
- module Ragel
15
- module ContentDispositionMachine
16
- %%write data;
17
-
18
- def self.parse(data)
19
- p = 0
20
- eof = data.length
21
- stack = []
22
-
23
- actions = []
24
- data_unpacked = data.bytes.to_a
25
- %%write init;
26
- %%write exec;
27
-
28
- if p == eof && cs >= %%{ write first_final; }%%
29
- return actions, nil
30
- else
31
- return [], "Only able to parse up to #{data[0..p]}"
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,614 +0,0 @@
1
-
2
- # line 1 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
3
-
4
- # line 10 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
5
-
6
-
7
- module Mail
8
- module Parsers
9
- module Ragel
10
- module ContentLocationMachine
11
-
12
- # line 13 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
13
- class << self
14
- attr_accessor :_content_location_trans_keys
15
- private :_content_location_trans_keys, :_content_location_trans_keys=
16
- end
17
- self._content_location_trans_keys = [
18
- 0, 0, 9, 126, 10, 10,
19
- 9, 32, 10, 10, 9,
20
- 32, 1, 127, 10, 10,
21
- 9, 32, -128, -1, 10, 10,
22
- 9, 32, 9, 126, 1,
23
- 127, 1, 127, 10, 10,
24
- 9, 32, 0, 127, 9, 126,
25
- 9, 40, 9, 40, 1,
26
- 127, 1, 127, 1, 127,
27
- 1, 127, 9, 126, 0, 0,
28
- 0
29
- ]
30
-
31
- class << self
32
- attr_accessor :_content_location_key_spans
33
- private :_content_location_key_spans, :_content_location_key_spans=
34
- end
35
- self._content_location_key_spans = [
36
- 0, 118, 1, 24, 1, 24, 127, 1,
37
- 24, 128, 1, 24, 118, 127, 127, 1,
38
- 24, 128, 118, 32, 32, 127, 127, 127,
39
- 127, 118, 0
40
- ]
41
-
42
- class << self
43
- attr_accessor :_content_location_index_offsets
44
- private :_content_location_index_offsets, :_content_location_index_offsets=
45
- end
46
- self._content_location_index_offsets = [
47
- 0, 0, 119, 121, 146, 148, 173, 301,
48
- 303, 328, 457, 459, 484, 603, 731, 859,
49
- 861, 886, 1015, 1134, 1167, 1200, 1328, 1456,
50
- 1584, 1712, 1831
51
- ]
52
-
53
- class << self
54
- attr_accessor :_content_location_indicies
55
- private :_content_location_indicies, :_content_location_indicies=
56
- end
57
- self._content_location_indicies = [
58
- 0, 1, 1, 1, 2, 1, 1, 1,
59
- 1, 1, 1, 1, 1, 1, 1, 1,
60
- 1, 1, 1, 1, 1, 1, 1, 0,
61
- 3, 4, 3, 3, 3, 3, 3, 5,
62
- 1, 3, 3, 3, 3, 3, 1, 3,
63
- 3, 3, 3, 3, 3, 3, 3, 3,
64
- 3, 1, 1, 1, 3, 1, 1, 1,
65
- 3, 3, 3, 3, 3, 3, 3, 3,
66
- 3, 3, 3, 3, 3, 3, 3, 3,
67
- 3, 3, 3, 3, 3, 3, 3, 3,
68
- 3, 3, 1, 1, 1, 3, 3, 3,
69
- 3, 3, 3, 3, 3, 3, 3, 3,
70
- 3, 3, 3, 3, 3, 3, 3, 3,
71
- 3, 3, 3, 3, 3, 3, 3, 3,
72
- 3, 3, 3, 3, 3, 3, 1, 6,
73
- 1, 0, 1, 1, 1, 1, 1, 1,
74
- 1, 1, 1, 1, 1, 1, 1, 1,
75
- 1, 1, 1, 1, 1, 1, 1, 1,
76
- 0, 1, 7, 1, 8, 1, 1, 1,
77
- 1, 1, 1, 1, 1, 1, 1, 1,
78
- 1, 1, 1, 1, 1, 1, 1, 1,
79
- 1, 1, 1, 8, 1, 9, 9, 9,
80
- 9, 9, 9, 9, 9, 9, 1, 9,
81
- 9, 10, 9, 9, 9, 9, 9, 9,
82
- 9, 9, 9, 9, 9, 9, 9, 9,
83
- 9, 9, 9, 9, 9, 9, 11, 9,
84
- 9, 9, 9, 9, 9, 9, 9, 9,
85
- 9, 9, 9, 9, 9, 9, 9, 9,
86
- 9, 9, 9, 9, 9, 9, 9, 9,
87
- 9, 9, 9, 9, 9, 9, 9, 9,
88
- 9, 9, 9, 9, 9, 9, 9, 9,
89
- 9, 9, 9, 9, 9, 9, 9, 9,
90
- 9, 9, 9, 9, 9, 9, 9, 9,
91
- 12, 9, 9, 9, 9, 9, 9, 9,
92
- 9, 9, 9, 9, 9, 9, 9, 9,
93
- 9, 9, 9, 9, 9, 9, 9, 9,
94
- 9, 9, 9, 9, 9, 9, 9, 9,
95
- 9, 9, 9, 9, 1, 13, 1, 9,
96
- 1, 1, 1, 1, 1, 1, 1, 1,
97
- 1, 1, 1, 1, 1, 1, 1, 1,
98
- 1, 1, 1, 1, 1, 1, 9, 1,
99
- 1, 1, 1, 1, 1, 1, 1, 1,
100
- 1, 1, 1, 1, 1, 1, 1, 1,
101
- 1, 1, 1, 1, 1, 1, 1, 1,
102
- 1, 1, 1, 1, 1, 1, 1, 1,
103
- 1, 1, 1, 1, 1, 1, 1, 1,
104
- 1, 1, 1, 1, 1, 1, 1, 1,
105
- 1, 1, 1, 1, 1, 1, 1, 1,
106
- 1, 1, 1, 1, 1, 1, 1, 1,
107
- 1, 1, 1, 1, 1, 1, 1, 1,
108
- 1, 1, 1, 1, 1, 1, 1, 1,
109
- 1, 1, 1, 1, 1, 1, 1, 1,
110
- 1, 1, 1, 1, 1, 1, 1, 1,
111
- 1, 1, 1, 1, 1, 1, 1, 1,
112
- 1, 1, 1, 1, 1, 1, 1, 1,
113
- 1, 1, 1, 1, 1, 1, 1, 1,
114
- 1, 1, 1, 1, 1, 1, 1, 1,
115
- 9, 14, 1, 15, 1, 1, 1, 1,
116
- 1, 1, 1, 1, 1, 1, 1, 1,
117
- 1, 1, 1, 1, 1, 1, 1, 1,
118
- 1, 1, 15, 1, 16, 1, 1, 1,
119
- 17, 1, 1, 1, 1, 1, 1, 1,
120
- 1, 1, 1, 1, 1, 1, 1, 1,
121
- 1, 1, 1, 16, 18, 19, 18, 18,
122
- 18, 18, 18, 20, 1, 18, 18, 18,
123
- 18, 18, 1, 18, 18, 18, 18, 18,
124
- 18, 18, 18, 18, 18, 1, 1, 1,
125
- 18, 1, 1, 1, 18, 18, 18, 18,
126
- 18, 18, 18, 18, 18, 18, 18, 18,
127
- 18, 18, 18, 18, 18, 18, 18, 18,
128
- 18, 18, 18, 18, 18, 18, 1, 1,
129
- 1, 18, 18, 18, 18, 18, 18, 18,
130
- 18, 18, 18, 18, 18, 18, 18, 18,
131
- 18, 18, 18, 18, 18, 18, 18, 18,
132
- 18, 18, 18, 18, 18, 18, 18, 18,
133
- 18, 18, 1, 21, 21, 21, 21, 21,
134
- 21, 21, 21, 21, 1, 21, 21, 22,
135
- 21, 21, 21, 21, 21, 21, 21, 21,
136
- 21, 21, 21, 21, 21, 21, 21, 21,
137
- 21, 21, 21, 21, 21, 21, 21, 21,
138
- 21, 21, 23, 24, 21, 21, 21, 21,
139
- 21, 21, 21, 21, 21, 21, 21, 21,
140
- 21, 21, 21, 21, 21, 21, 21, 21,
141
- 21, 21, 21, 21, 21, 21, 21, 21,
142
- 21, 21, 21, 21, 21, 21, 21, 21,
143
- 21, 21, 21, 21, 21, 21, 21, 21,
144
- 21, 21, 21, 21, 21, 21, 25, 21,
145
- 21, 21, 21, 21, 21, 21, 21, 21,
146
- 21, 21, 21, 21, 21, 21, 21, 21,
147
- 21, 21, 21, 21, 21, 21, 21, 21,
148
- 21, 21, 21, 21, 21, 21, 21, 21,
149
- 21, 21, 1, 26, 26, 26, 26, 26,
150
- 26, 26, 26, 26, 1, 26, 26, 27,
151
- 26, 26, 26, 26, 26, 26, 26, 26,
152
- 26, 26, 26, 26, 26, 26, 26, 26,
153
- 26, 26, 26, 26, 26, 26, 26, 26,
154
- 26, 26, 28, 29, 26, 26, 26, 26,
155
- 26, 26, 26, 26, 26, 26, 26, 26,
156
- 26, 26, 26, 26, 26, 26, 26, 26,
157
- 26, 26, 26, 26, 26, 26, 26, 26,
158
- 26, 26, 26, 26, 26, 26, 26, 26,
159
- 26, 26, 26, 26, 26, 26, 26, 26,
160
- 26, 26, 26, 26, 26, 26, 30, 26,
161
- 26, 26, 26, 26, 26, 26, 26, 26,
162
- 26, 26, 26, 26, 26, 26, 26, 26,
163
- 26, 26, 26, 26, 26, 26, 26, 26,
164
- 26, 26, 26, 26, 26, 26, 26, 26,
165
- 26, 26, 1, 31, 1, 26, 1, 1,
166
- 1, 1, 1, 1, 1, 1, 1, 1,
167
- 1, 1, 1, 1, 1, 1, 1, 1,
168
- 1, 1, 1, 1, 26, 1, 26, 26,
169
- 26, 26, 26, 26, 26, 26, 26, 26,
170
- 26, 26, 26, 26, 26, 26, 26, 26,
171
- 26, 26, 26, 26, 26, 26, 26, 26,
172
- 26, 26, 26, 26, 26, 26, 26, 26,
173
- 26, 26, 26, 26, 26, 26, 26, 26,
174
- 26, 26, 26, 26, 26, 26, 26, 26,
175
- 26, 26, 26, 26, 26, 26, 26, 26,
176
- 26, 26, 26, 26, 26, 26, 26, 26,
177
- 26, 26, 26, 26, 26, 26, 26, 26,
178
- 26, 26, 26, 26, 26, 26, 26, 26,
179
- 26, 26, 26, 26, 26, 26, 26, 26,
180
- 26, 26, 26, 26, 26, 26, 26, 26,
181
- 26, 26, 26, 26, 26, 26, 26, 26,
182
- 26, 26, 26, 26, 26, 26, 26, 26,
183
- 26, 26, 26, 26, 26, 26, 26, 26,
184
- 26, 26, 26, 26, 26, 26, 1, 32,
185
- 1, 1, 1, 33, 1, 1, 1, 1,
186
- 1, 1, 1, 1, 1, 1, 1, 1,
187
- 1, 1, 1, 1, 1, 1, 32, 34,
188
- 34, 34, 34, 34, 34, 34, 35, 1,
189
- 34, 34, 34, 34, 34, 1, 34, 34,
190
- 34, 34, 34, 34, 34, 34, 34, 34,
191
- 1, 1, 1, 34, 1, 1, 1, 34,
192
- 34, 34, 34, 34, 34, 34, 34, 34,
193
- 34, 34, 34, 34, 34, 34, 34, 34,
194
- 34, 34, 34, 34, 34, 34, 34, 34,
195
- 34, 1, 1, 1, 34, 34, 34, 34,
196
- 34, 34, 34, 34, 34, 34, 34, 34,
197
- 34, 34, 34, 34, 34, 34, 34, 34,
198
- 34, 34, 34, 34, 34, 34, 34, 34,
199
- 34, 34, 34, 34, 34, 1, 8, 1,
200
- 1, 1, 36, 1, 1, 1, 1, 1,
201
- 1, 1, 1, 1, 1, 1, 1, 1,
202
- 1, 1, 1, 1, 1, 8, 1, 1,
203
- 1, 1, 1, 1, 1, 37, 1, 38,
204
- 1, 1, 1, 39, 1, 1, 1, 1,
205
- 1, 1, 1, 1, 1, 1, 1, 1,
206
- 1, 1, 1, 1, 1, 1, 38, 1,
207
- 1, 1, 1, 1, 1, 1, 40, 1,
208
- 41, 41, 41, 41, 41, 41, 41, 41,
209
- 42, 1, 41, 41, 43, 41, 41, 41,
210
- 41, 41, 41, 41, 41, 41, 41, 41,
211
- 41, 41, 41, 41, 41, 41, 41, 42,
212
- 44, 45, 44, 44, 44, 44, 44, 46,
213
- 41, 44, 44, 44, 44, 44, 41, 44,
214
- 44, 44, 44, 44, 44, 44, 44, 44,
215
- 44, 41, 41, 41, 44, 41, 41, 41,
216
- 44, 44, 44, 44, 44, 44, 44, 44,
217
- 44, 44, 44, 44, 44, 44, 44, 44,
218
- 44, 44, 44, 44, 44, 44, 44, 44,
219
- 44, 44, 41, 47, 41, 44, 44, 44,
220
- 44, 44, 44, 44, 44, 44, 44, 44,
221
- 44, 44, 44, 44, 44, 44, 44, 44,
222
- 44, 44, 44, 44, 44, 44, 44, 44,
223
- 44, 44, 44, 44, 44, 44, 41, 1,
224
- 9, 9, 9, 9, 9, 9, 9, 9,
225
- 15, 1, 9, 9, 48, 9, 9, 9,
226
- 9, 9, 9, 9, 9, 9, 9, 9,
227
- 9, 9, 9, 9, 9, 9, 9, 15,
228
- 9, 11, 9, 9, 9, 9, 9, 49,
229
- 9, 9, 9, 9, 9, 9, 9, 9,
230
- 9, 9, 9, 9, 9, 9, 9, 9,
231
- 9, 9, 9, 9, 9, 9, 9, 9,
232
- 9, 9, 9, 9, 9, 9, 9, 9,
233
- 9, 9, 9, 9, 9, 9, 9, 9,
234
- 9, 9, 9, 9, 9, 9, 9, 9,
235
- 9, 9, 9, 12, 9, 9, 9, 9,
236
- 9, 9, 9, 9, 9, 9, 9, 9,
237
- 9, 9, 9, 9, 9, 9, 9, 9,
238
- 9, 9, 9, 9, 9, 9, 9, 9,
239
- 9, 9, 9, 9, 9, 9, 9, 1,
240
- 9, 9, 9, 9, 9, 9, 9, 9,
241
- 50, 1, 9, 9, 51, 9, 9, 9,
242
- 9, 9, 9, 9, 9, 9, 9, 9,
243
- 9, 9, 9, 9, 9, 9, 9, 50,
244
- 9, 11, 9, 9, 9, 9, 9, 52,
245
- 9, 9, 9, 9, 9, 9, 9, 9,
246
- 9, 9, 9, 9, 9, 9, 9, 9,
247
- 9, 9, 9, 9, 9, 9, 9, 9,
248
- 9, 9, 9, 9, 9, 9, 9, 9,
249
- 9, 9, 9, 9, 9, 9, 9, 9,
250
- 9, 9, 9, 9, 9, 9, 9, 9,
251
- 9, 9, 9, 12, 9, 9, 9, 9,
252
- 9, 9, 9, 9, 9, 9, 9, 9,
253
- 9, 9, 9, 9, 9, 9, 9, 9,
254
- 9, 9, 9, 9, 9, 9, 9, 9,
255
- 9, 9, 9, 9, 9, 9, 9, 1,
256
- 9, 9, 9, 9, 9, 9, 9, 9,
257
- 53, 1, 9, 9, 54, 9, 9, 9,
258
- 9, 9, 9, 9, 9, 9, 9, 9,
259
- 9, 9, 9, 9, 9, 9, 9, 53,
260
- 55, 56, 55, 55, 55, 55, 55, 57,
261
- 9, 55, 55, 55, 55, 55, 9, 55,
262
- 55, 55, 55, 55, 55, 55, 55, 55,
263
- 55, 9, 9, 9, 55, 9, 9, 9,
264
- 55, 55, 55, 55, 55, 55, 55, 55,
265
- 55, 55, 55, 55, 55, 55, 55, 55,
266
- 55, 55, 55, 55, 55, 55, 55, 55,
267
- 55, 55, 9, 12, 9, 55, 55, 55,
268
- 55, 55, 55, 55, 55, 55, 55, 55,
269
- 55, 55, 55, 55, 55, 55, 55, 55,
270
- 55, 55, 55, 55, 55, 55, 55, 55,
271
- 55, 55, 55, 55, 55, 55, 9, 1,
272
- 32, 1, 1, 1, 33, 1, 1, 1,
273
- 1, 1, 1, 1, 1, 1, 1, 1,
274
- 1, 1, 1, 1, 1, 1, 1, 32,
275
- 34, 34, 34, 34, 34, 34, 34, 58,
276
- 1, 34, 34, 34, 34, 34, 1, 34,
277
- 34, 34, 34, 34, 34, 34, 34, 34,
278
- 34, 1, 1, 1, 34, 1, 1, 1,
279
- 34, 34, 34, 34, 34, 34, 34, 34,
280
- 34, 34, 34, 34, 34, 34, 34, 34,
281
- 34, 34, 34, 34, 34, 34, 34, 34,
282
- 34, 34, 1, 1, 1, 34, 34, 34,
283
- 34, 34, 34, 34, 34, 34, 34, 34,
284
- 34, 34, 34, 34, 34, 34, 34, 34,
285
- 34, 34, 34, 34, 34, 34, 34, 34,
286
- 34, 34, 34, 34, 34, 34, 1, 1,
287
- 0
288
- ]
289
-
290
- class << self
291
- attr_accessor :_content_location_trans_targs
292
- private :_content_location_trans_targs, :_content_location_trans_targs=
293
- end
294
- self._content_location_trans_targs = [
295
- 1, 0, 2, 18, 21, 12, 3, 5,
296
- 19, 6, 7, 19, 9, 8, 11, 22,
297
- 1, 2, 18, 21, 12, 14, 15, 14,
298
- 26, 17, 14, 15, 14, 26, 17, 16,
299
- 19, 4, 18, 20, 4, 20, 19, 4,
300
- 20, 6, 22, 10, 24, 25, 23, 9,
301
- 10, 23, 22, 10, 23, 22, 10, 24,
302
- 25, 23, 20
303
- ]
304
-
305
- class << self
306
- attr_accessor :_content_location_trans_actions
307
- private :_content_location_trans_actions, :_content_location_trans_actions=
308
- end
309
- self._content_location_trans_actions = [
310
- 0, 0, 0, 1, 1, 2, 0, 0,
311
- 0, 0, 0, 3, 0, 0, 0, 0,
312
- 4, 4, 5, 5, 6, 7, 7, 8,
313
- 9, 7, 0, 0, 2, 10, 0, 0,
314
- 11, 11, 0, 12, 0, 2, 4, 4,
315
- 6, 13, 14, 14, 13, 15, 16, 13,
316
- 0, 2, 4, 4, 6, 11, 11, 0,
317
- 3, 12, 17
318
- ]
319
-
320
- class << self
321
- attr_accessor :_content_location_eof_actions
322
- private :_content_location_eof_actions, :_content_location_eof_actions=
323
- end
324
- self._content_location_eof_actions = [
325
- 0, 0, 0, 0, 0, 0, 0, 0,
326
- 0, 0, 0, 0, 0, 0, 0, 0,
327
- 0, 0, 11, 0, 4, 11, 0, 4,
328
- 11, 11, 0
329
- ]
330
-
331
- class << self
332
- attr_accessor :content_location_start
333
- end
334
- self.content_location_start = 1;
335
- class << self
336
- attr_accessor :content_location_first_final
337
- end
338
- self.content_location_first_final = 18;
339
- class << self
340
- attr_accessor :content_location_error
341
- end
342
- self.content_location_error = 0;
343
-
344
- class << self
345
- attr_accessor :content_location_en_comment_tail
346
- end
347
- self.content_location_en_comment_tail = 13;
348
- class << self
349
- attr_accessor :content_location_en_main
350
- end
351
- self.content_location_en_main = 1;
352
-
353
-
354
- # line 17 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
355
-
356
- def self.parse(data)
357
- p = 0
358
- eof = data.length
359
- stack = []
360
-
361
- actions = []
362
- data_unpacked = data.bytes.to_a
363
-
364
- # line 365 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
365
- begin
366
- p ||= 0
367
- pe ||= data.length
368
- cs = content_location_start
369
- top = 0
370
- end
371
-
372
- # line 26 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
373
-
374
- # line 375 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
375
- begin
376
- testEof = false
377
- _slen, _trans, _keys, _inds, _acts, _nacts = nil
378
- _goto_level = 0
379
- _resume = 10
380
- _eof_trans = 15
381
- _again = 20
382
- _test_eof = 30
383
- _out = 40
384
- while true
385
- if _goto_level <= 0
386
- if p == pe
387
- _goto_level = _test_eof
388
- next
389
- end
390
- if cs == 0
391
- _goto_level = _out
392
- next
393
- end
394
- end
395
- if _goto_level <= _resume
396
- _keys = cs << 1
397
- _inds = _content_location_index_offsets[cs]
398
- _slen = _content_location_key_spans[cs]
399
- _trans = if ( _slen > 0 &&
400
- _content_location_trans_keys[_keys] <= ( data_unpacked[p]) &&
401
- ( data_unpacked[p]) <= _content_location_trans_keys[_keys + 1]
402
- ) then
403
- _content_location_indicies[ _inds + ( data_unpacked[p]) - _content_location_trans_keys[_keys] ]
404
- else
405
- _content_location_indicies[ _inds + _slen ]
406
- end
407
- cs = _content_location_trans_targs[_trans]
408
- if _content_location_trans_actions[_trans] != 0
409
- case _content_location_trans_actions[_trans]
410
- when 4 then
411
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
412
- begin
413
- actions.push(4, p) end
414
- when 7 then
415
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
416
- begin
417
- actions.push(5, p) end
418
- when 3 then
419
- # line 41 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
420
- begin
421
- actions.push(38, p) end
422
- when 13 then
423
- # line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
424
- begin
425
- actions.push(39, p) end
426
- when 11 then
427
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
428
- begin
429
- actions.push(46, p) end
430
- when 1 then
431
- # line 50 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
432
- begin
433
- actions.push(47, p) end
434
- when 2 then
435
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
436
- begin
437
- begin
438
- stack[top] = cs
439
- top+= 1
440
- cs = 13
441
- _goto_level = _again
442
- next
443
- end
444
- end
445
- when 10 then
446
- # line 6 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
447
- begin
448
- begin
449
- top -= 1
450
- cs = stack[top]
451
- _goto_level = _again
452
- next
453
- end
454
- end
455
- when 5 then
456
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
457
- begin
458
- actions.push(4, p) end
459
- # line 50 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
460
- begin
461
- actions.push(47, p) end
462
- when 6 then
463
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
464
- begin
465
- actions.push(4, p) end
466
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
467
- begin
468
- begin
469
- stack[top] = cs
470
- top+= 1
471
- cs = 13
472
- _goto_level = _again
473
- next
474
- end
475
- end
476
- when 8 then
477
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
478
- begin
479
- actions.push(5, p) end
480
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
481
- begin
482
- begin
483
- stack[top] = cs
484
- top+= 1
485
- cs = 13
486
- _goto_level = _again
487
- next
488
- end
489
- end
490
- when 9 then
491
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
492
- begin
493
- actions.push(5, p) end
494
- # line 6 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
495
- begin
496
- begin
497
- top -= 1
498
- cs = stack[top]
499
- _goto_level = _again
500
- next
501
- end
502
- end
503
- when 15 then
504
- # line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
505
- begin
506
- actions.push(39, p) end
507
- # line 41 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
508
- begin
509
- actions.push(38, p) end
510
- when 14 then
511
- # line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
512
- begin
513
- actions.push(39, p) end
514
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
515
- begin
516
- actions.push(46, p) end
517
- when 12 then
518
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
519
- begin
520
- actions.push(46, p) end
521
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
522
- begin
523
- begin
524
- stack[top] = cs
525
- top+= 1
526
- cs = 13
527
- _goto_level = _again
528
- next
529
- end
530
- end
531
- when 17 then
532
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
533
- begin
534
- begin
535
- stack[top] = cs
536
- top+= 1
537
- cs = 13
538
- _goto_level = _again
539
- next
540
- end
541
- end
542
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
543
- begin
544
- actions.push(46, p) end
545
- when 16 then
546
- # line 42 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
547
- begin
548
- actions.push(39, p) end
549
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
550
- begin
551
- actions.push(46, p) end
552
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
553
- begin
554
- begin
555
- stack[top] = cs
556
- top+= 1
557
- cs = 13
558
- _goto_level = _again
559
- next
560
- end
561
- end
562
- # line 563 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
563
- end
564
- end
565
- end
566
- if _goto_level <= _again
567
- if cs == 0
568
- _goto_level = _out
569
- next
570
- end
571
- p += 1
572
- if p != pe
573
- _goto_level = _resume
574
- next
575
- end
576
- end
577
- if _goto_level <= _test_eof
578
- if p == eof
579
- case _content_location_eof_actions[cs]
580
- when 4 then
581
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
582
- begin
583
- actions.push(4, p) end
584
- when 11 then
585
- # line 49 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
586
- begin
587
- actions.push(46, p) end
588
- # line 589 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
589
- end
590
- end
591
-
592
- end
593
- if _goto_level <= _out
594
- break
595
- end
596
- end
597
- end
598
-
599
- # line 27 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
600
-
601
- if p == eof && cs >=
602
- # line 603 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb"
603
- 18
604
- # line 28 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl"
605
-
606
- return actions, nil
607
- else
608
- return [], "Only able to parse up to #{data[0..p]}"
609
- end
610
- end
611
- end
612
- end
613
- end
614
- end
@@ -1,37 +0,0 @@
1
- %%{
2
- machine content_location;
3
-
4
- include rb_actions "rb_actions.rl";
5
- include common "../../common.rl";
6
-
7
- getkey data_unpacked[p];
8
-
9
- main := content_location;
10
- }%%
11
-
12
- module Mail
13
- module Parsers
14
- module Ragel
15
- module ContentLocationMachine
16
- %%write data;
17
-
18
- def self.parse(data)
19
- p = 0
20
- eof = data.length
21
- stack = []
22
-
23
- actions = []
24
- data_unpacked = data.bytes.to_a
25
- %%write init;
26
- %%write exec;
27
-
28
- if p == eof && cs >= %%{ write first_final; }%%
29
- return actions, nil
30
- else
31
- return [], "Only able to parse up to #{data[0..p]}"
32
- end
33
- end
34
- end
35
- end
36
- end
37
- end