mail 2.6.6 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (180) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +134 -119
  4. data/lib/mail/attachments_list.rb +10 -9
  5. data/lib/mail/body.rb +73 -84
  6. data/lib/mail/check_delivery_params.rb +28 -21
  7. data/lib/mail/configuration.rb +2 -0
  8. data/lib/mail/constants.rb +27 -5
  9. data/lib/mail/elements/address.rb +53 -47
  10. data/lib/mail/elements/address_list.rb +11 -19
  11. data/lib/mail/elements/content_disposition_element.rb +9 -16
  12. data/lib/mail/elements/content_location_element.rb +6 -11
  13. data/lib/mail/elements/content_transfer_encoding_element.rb +6 -11
  14. data/lib/mail/elements/content_type_element.rb +16 -23
  15. data/lib/mail/elements/date_time_element.rb +7 -15
  16. data/lib/mail/elements/envelope_from_element.rb +22 -23
  17. data/lib/mail/elements/message_ids_element.rb +18 -13
  18. data/lib/mail/elements/mime_version_element.rb +7 -15
  19. data/lib/mail/elements/phrase_list.rb +12 -10
  20. data/lib/mail/elements/received_element.rb +27 -19
  21. data/lib/mail/encodings/7bit.rb +9 -14
  22. data/lib/mail/encodings/8bit.rb +2 -21
  23. data/lib/mail/encodings/base64.rb +11 -12
  24. data/lib/mail/encodings/binary.rb +3 -22
  25. data/lib/mail/encodings/identity.rb +24 -0
  26. data/lib/mail/encodings/quoted_printable.rb +6 -6
  27. data/lib/mail/encodings/transfer_encoding.rb +38 -29
  28. data/lib/mail/encodings/unix_to_unix.rb +3 -1
  29. data/lib/mail/encodings.rb +81 -54
  30. data/lib/mail/envelope.rb +11 -14
  31. data/lib/mail/field.rb +119 -98
  32. data/lib/mail/field_list.rb +60 -7
  33. data/lib/mail/fields/bcc_field.rb +34 -52
  34. data/lib/mail/fields/cc_field.rb +28 -49
  35. data/lib/mail/fields/comments_field.rb +27 -37
  36. data/lib/mail/fields/common_address_field.rb +170 -0
  37. data/lib/mail/fields/common_date_field.rb +58 -0
  38. data/lib/mail/fields/common_field.rb +77 -0
  39. data/lib/mail/fields/common_message_id_field.rb +42 -0
  40. data/lib/mail/fields/content_description_field.rb +7 -14
  41. data/lib/mail/fields/content_disposition_field.rb +13 -38
  42. data/lib/mail/fields/content_id_field.rb +24 -51
  43. data/lib/mail/fields/content_location_field.rb +11 -25
  44. data/lib/mail/fields/content_transfer_encoding_field.rb +31 -31
  45. data/lib/mail/fields/content_type_field.rb +50 -80
  46. data/lib/mail/fields/date_field.rb +23 -52
  47. data/lib/mail/fields/from_field.rb +28 -49
  48. data/lib/mail/fields/in_reply_to_field.rb +38 -49
  49. data/lib/mail/fields/keywords_field.rb +18 -31
  50. data/lib/mail/fields/message_id_field.rb +25 -71
  51. data/lib/mail/fields/mime_version_field.rb +19 -30
  52. data/lib/mail/fields/named_structured_field.rb +11 -0
  53. data/lib/mail/fields/named_unstructured_field.rb +11 -0
  54. data/lib/mail/fields/optional_field.rb +9 -7
  55. data/lib/mail/fields/{common/parameter_hash.rb → parameter_hash.rb} +13 -11
  56. data/lib/mail/fields/received_field.rb +43 -57
  57. data/lib/mail/fields/references_field.rb +35 -49
  58. data/lib/mail/fields/reply_to_field.rb +28 -49
  59. data/lib/mail/fields/resent_bcc_field.rb +28 -49
  60. data/lib/mail/fields/resent_cc_field.rb +28 -49
  61. data/lib/mail/fields/resent_date_field.rb +5 -30
  62. data/lib/mail/fields/resent_from_field.rb +28 -49
  63. data/lib/mail/fields/resent_message_id_field.rb +5 -29
  64. data/lib/mail/fields/resent_sender_field.rb +27 -56
  65. data/lib/mail/fields/resent_to_field.rb +28 -49
  66. data/lib/mail/fields/return_path_field.rb +50 -54
  67. data/lib/mail/fields/sender_field.rb +34 -55
  68. data/lib/mail/fields/structured_field.rb +3 -30
  69. data/lib/mail/fields/subject_field.rb +9 -11
  70. data/lib/mail/fields/to_field.rb +28 -49
  71. data/lib/mail/fields/unstructured_field.rb +32 -47
  72. data/lib/mail/header.rb +71 -110
  73. data/lib/mail/mail.rb +2 -10
  74. data/lib/mail/matchers/attachment_matchers.rb +15 -0
  75. data/lib/mail/matchers/has_sent_mail.rb +21 -1
  76. data/lib/mail/message.rb +113 -117
  77. data/lib/mail/multibyte/chars.rb +21 -178
  78. data/lib/mail/multibyte/unicode.rb +10 -10
  79. data/lib/mail/multibyte/utils.rb +26 -43
  80. data/lib/mail/multibyte.rb +55 -16
  81. data/lib/mail/network/delivery_methods/exim.rb +5 -4
  82. data/lib/mail/network/delivery_methods/file_delivery.rb +11 -10
  83. data/lib/mail/network/delivery_methods/logger_delivery.rb +34 -0
  84. data/lib/mail/network/delivery_methods/sendmail.rb +62 -21
  85. data/lib/mail/network/delivery_methods/smtp.rb +75 -50
  86. data/lib/mail/network/delivery_methods/smtp_connection.rb +3 -4
  87. data/lib/mail/network/delivery_methods/test_mailer.rb +4 -2
  88. data/lib/mail/network/retriever_methods/base.rb +8 -8
  89. data/lib/mail/network/retriever_methods/imap.rb +20 -7
  90. data/lib/mail/network/retriever_methods/pop3.rb +5 -3
  91. data/lib/mail/network/retriever_methods/test_retriever.rb +2 -1
  92. data/lib/mail/network.rb +1 -0
  93. data/lib/mail/parser_tools.rb +15 -0
  94. data/lib/mail/parsers/address_lists_parser.rb +33225 -116
  95. data/lib/mail/parsers/address_lists_parser.rl +179 -0
  96. data/lib/mail/parsers/content_disposition_parser.rb +882 -49
  97. data/lib/mail/parsers/content_disposition_parser.rl +89 -0
  98. data/lib/mail/parsers/content_location_parser.rb +809 -23
  99. data/lib/mail/parsers/content_location_parser.rl +78 -0
  100. data/lib/mail/parsers/content_transfer_encoding_parser.rb +509 -21
  101. data/lib/mail/parsers/content_transfer_encoding_parser.rl +71 -0
  102. data/lib/mail/parsers/content_type_parser.rb +1037 -56
  103. data/lib/mail/parsers/content_type_parser.rl +90 -0
  104. data/lib/mail/parsers/date_time_parser.rb +877 -25
  105. data/lib/mail/parsers/date_time_parser.rl +69 -0
  106. data/lib/mail/parsers/envelope_from_parser.rb +3669 -40
  107. data/lib/mail/parsers/envelope_from_parser.rl +89 -0
  108. data/lib/mail/parsers/message_ids_parser.rb +5146 -25
  109. data/lib/mail/parsers/message_ids_parser.rl +93 -0
  110. data/lib/mail/parsers/mime_version_parser.rb +497 -26
  111. data/lib/mail/parsers/mime_version_parser.rl +68 -0
  112. data/lib/mail/parsers/phrase_lists_parser.rb +870 -22
  113. data/lib/mail/parsers/phrase_lists_parser.rl +90 -0
  114. data/lib/mail/parsers/received_parser.rb +8776 -43
  115. data/lib/mail/parsers/received_parser.rl +91 -0
  116. data/lib/mail/parsers/rfc2045_content_transfer_encoding.rl +13 -0
  117. data/lib/mail/parsers/rfc2045_content_type.rl +25 -0
  118. data/lib/mail/parsers/rfc2045_mime.rl +16 -0
  119. data/lib/mail/parsers/rfc2183_content_disposition.rl +15 -0
  120. data/lib/mail/parsers/rfc3629_utf8.rl +19 -0
  121. data/lib/mail/parsers/rfc5234_abnf_core_rules.rl +22 -0
  122. data/lib/mail/parsers/rfc5322.rl +74 -0
  123. data/lib/mail/parsers/rfc5322_address.rl +72 -0
  124. data/lib/mail/parsers/{ragel/date_time.rl → rfc5322_date_time.rl} +8 -1
  125. data/lib/mail/parsers/rfc5322_lexical_tokens.rl +60 -0
  126. data/lib/mail/parsers.rb +11 -25
  127. data/lib/mail/part.rb +6 -10
  128. data/lib/mail/parts_list.rb +62 -6
  129. data/lib/mail/smtp_envelope.rb +57 -0
  130. data/lib/mail/utilities.rb +343 -74
  131. data/lib/mail/version.rb +2 -2
  132. data/lib/mail/yaml.rb +30 -0
  133. data/lib/mail.rb +5 -35
  134. metadata +111 -66
  135. data/CHANGELOG.rdoc +0 -803
  136. data/CONTRIBUTING.md +0 -60
  137. data/Dependencies.txt +0 -2
  138. data/Gemfile +0 -14
  139. data/Rakefile +0 -29
  140. data/TODO.rdoc +0 -9
  141. data/lib/mail/core_extensions/smtp.rb +0 -25
  142. data/lib/mail/core_extensions/string/access.rb +0 -146
  143. data/lib/mail/core_extensions/string/multibyte.rb +0 -79
  144. data/lib/mail/core_extensions/string.rb +0 -21
  145. data/lib/mail/fields/common/address_container.rb +0 -17
  146. data/lib/mail/fields/common/common_address.rb +0 -136
  147. data/lib/mail/fields/common/common_date.rb +0 -36
  148. data/lib/mail/fields/common/common_field.rb +0 -61
  149. data/lib/mail/fields/common/common_message_id.rb +0 -49
  150. data/lib/mail/multibyte/exceptions.rb +0 -9
  151. data/lib/mail/parsers/ragel/common.rl +0 -185
  152. data/lib/mail/parsers/ragel/parser_info.rb +0 -61
  153. data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb +0 -14864
  154. data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb.rl +0 -37
  155. data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb +0 -751
  156. data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb.rl +0 -37
  157. data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb +0 -614
  158. data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl +0 -37
  159. data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb +0 -447
  160. data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl +0 -37
  161. data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb +0 -825
  162. data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb.rl +0 -37
  163. data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb +0 -817
  164. data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb.rl +0 -37
  165. data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb +0 -2149
  166. data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb.rl +0 -37
  167. data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb +0 -1570
  168. data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb.rl +0 -37
  169. data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb +0 -440
  170. data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb.rl +0 -37
  171. data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb +0 -564
  172. data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl +0 -37
  173. data/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl +0 -51
  174. data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb +0 -5144
  175. data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb.rl +0 -37
  176. data/lib/mail/parsers/ragel/ruby/parser.rb.rl.erb +0 -37
  177. data/lib/mail/parsers/ragel/ruby.rb +0 -40
  178. data/lib/mail/parsers/ragel.rb +0 -18
  179. data/lib/mail/version_specific/ruby_1_8.rb +0 -126
  180. data/lib/mail/version_specific/ruby_1_9.rb +0 -226
@@ -1,447 +0,0 @@
1
-
2
- # line 1 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl"
3
-
4
- # line 10 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl"
5
-
6
-
7
- module Mail
8
- module Parsers
9
- module Ragel
10
- module ContentTransferEncodingMachine
11
-
12
- # line 13 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb"
13
- class << self
14
- attr_accessor :_content_transfer_encoding_trans_keys
15
- private :_content_transfer_encoding_trans_keys, :_content_transfer_encoding_trans_keys=
16
- end
17
- self._content_transfer_encoding_trans_keys = [
18
- 0, 0, 9, 126, 10, 10,
19
- 9, 32, 10, 10, 9,
20
- 32, 10, 10, 9, 32,
21
- 9, 126, 1, 127, 1, 127,
22
- 10, 10, 9, 32, -128,
23
- -1, 9, 126, 9, 59,
24
- 9, 59, 9, 40, 9, 40,
25
- 0, 0, 0
26
- ]
27
-
28
- class << self
29
- attr_accessor :_content_transfer_encoding_key_spans
30
- private :_content_transfer_encoding_key_spans, :_content_transfer_encoding_key_spans=
31
- end
32
- self._content_transfer_encoding_key_spans = [
33
- 0, 118, 1, 24, 1, 24, 1, 24,
34
- 118, 127, 127, 1, 24, 128, 118, 51,
35
- 51, 32, 32, 0
36
- ]
37
-
38
- class << self
39
- attr_accessor :_content_transfer_encoding_index_offsets
40
- private :_content_transfer_encoding_index_offsets, :_content_transfer_encoding_index_offsets=
41
- end
42
- self._content_transfer_encoding_index_offsets = [
43
- 0, 0, 119, 121, 146, 148, 173, 175,
44
- 200, 319, 447, 575, 577, 602, 731, 850,
45
- 902, 954, 987, 1020
46
- ]
47
-
48
- class << self
49
- attr_accessor :_content_transfer_encoding_indicies
50
- private :_content_transfer_encoding_indicies, :_content_transfer_encoding_indicies=
51
- end
52
- self._content_transfer_encoding_indicies = [
53
- 0, 1, 1, 1, 2, 1, 1, 1,
54
- 1, 1, 1, 1, 1, 1, 1, 1,
55
- 1, 1, 1, 1, 1, 1, 1, 0,
56
- 3, 3, 3, 3, 3, 3, 3, 4,
57
- 1, 3, 3, 3, 3, 3, 1, 3,
58
- 3, 3, 3, 3, 3, 3, 3, 3,
59
- 3, 1, 1, 1, 1, 1, 1, 1,
60
- 3, 3, 3, 3, 3, 3, 3, 3,
61
- 3, 3, 3, 3, 3, 3, 3, 3,
62
- 3, 3, 3, 3, 3, 3, 3, 3,
63
- 3, 3, 1, 1, 1, 3, 3, 3,
64
- 3, 3, 3, 3, 3, 3, 3, 3,
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, 1, 5,
68
- 1, 0, 1, 1, 1, 1, 1, 1,
69
- 1, 1, 1, 1, 1, 1, 1, 1,
70
- 1, 1, 1, 1, 1, 1, 1, 1,
71
- 0, 1, 6, 1, 7, 1, 1, 1,
72
- 1, 1, 1, 1, 1, 1, 1, 1,
73
- 1, 1, 1, 1, 1, 1, 1, 1,
74
- 1, 1, 1, 7, 1, 8, 1, 9,
75
- 1, 1, 1, 1, 1, 1, 1, 1,
76
- 1, 1, 1, 1, 1, 1, 1, 1,
77
- 1, 1, 1, 1, 1, 1, 9, 1,
78
- 10, 1, 1, 1, 11, 1, 1, 1,
79
- 1, 1, 1, 1, 1, 1, 1, 1,
80
- 1, 1, 1, 1, 1, 1, 1, 10,
81
- 12, 12, 12, 12, 12, 12, 12, 13,
82
- 1, 12, 12, 12, 12, 12, 1, 12,
83
- 12, 12, 12, 12, 12, 12, 12, 12,
84
- 12, 1, 1, 1, 1, 1, 1, 1,
85
- 12, 12, 12, 12, 12, 12, 12, 12,
86
- 12, 12, 12, 12, 12, 12, 12, 12,
87
- 12, 12, 12, 12, 12, 12, 12, 12,
88
- 12, 12, 1, 1, 1, 12, 12, 12,
89
- 12, 12, 12, 12, 12, 12, 12, 12,
90
- 12, 12, 12, 12, 12, 12, 12, 12,
91
- 12, 12, 12, 12, 12, 12, 12, 12,
92
- 12, 12, 12, 12, 12, 12, 1, 14,
93
- 14, 14, 14, 14, 14, 14, 14, 14,
94
- 1, 14, 14, 15, 14, 14, 14, 14,
95
- 14, 14, 14, 14, 14, 14, 14, 14,
96
- 14, 14, 14, 14, 14, 14, 14, 14,
97
- 14, 14, 14, 14, 14, 14, 16, 17,
98
- 14, 14, 14, 14, 14, 14, 14, 14,
99
- 14, 14, 14, 14, 14, 14, 14, 14,
100
- 14, 14, 14, 14, 14, 14, 14, 14,
101
- 14, 14, 14, 14, 14, 14, 14, 14,
102
- 14, 14, 14, 14, 14, 14, 14, 14,
103
- 14, 14, 14, 14, 14, 14, 14, 14,
104
- 14, 14, 18, 14, 14, 14, 14, 14,
105
- 14, 14, 14, 14, 14, 14, 14, 14,
106
- 14, 14, 14, 14, 14, 14, 14, 14,
107
- 14, 14, 14, 14, 14, 14, 14, 14,
108
- 14, 14, 14, 14, 14, 14, 1, 19,
109
- 19, 19, 19, 19, 19, 19, 19, 19,
110
- 1, 19, 19, 20, 19, 19, 19, 19,
111
- 19, 19, 19, 19, 19, 19, 19, 19,
112
- 19, 19, 19, 19, 19, 19, 19, 19,
113
- 19, 19, 19, 19, 19, 19, 21, 22,
114
- 19, 19, 19, 19, 19, 19, 19, 19,
115
- 19, 19, 19, 19, 19, 19, 19, 19,
116
- 19, 19, 19, 19, 19, 19, 19, 19,
117
- 19, 19, 19, 19, 19, 19, 19, 19,
118
- 19, 19, 19, 19, 19, 19, 19, 19,
119
- 19, 19, 19, 19, 19, 19, 19, 19,
120
- 19, 19, 23, 19, 19, 19, 19, 19,
121
- 19, 19, 19, 19, 19, 19, 19, 19,
122
- 19, 19, 19, 19, 19, 19, 19, 19,
123
- 19, 19, 19, 19, 19, 19, 19, 19,
124
- 19, 19, 19, 19, 19, 19, 1, 24,
125
- 1, 19, 1, 1, 1, 1, 1, 1,
126
- 1, 1, 1, 1, 1, 1, 1, 1,
127
- 1, 1, 1, 1, 1, 1, 1, 1,
128
- 19, 1, 1, 1, 1, 1, 1, 1,
129
- 1, 1, 1, 1, 1, 1, 1, 1,
130
- 1, 1, 1, 1, 1, 1, 1, 1,
131
- 1, 1, 1, 1, 1, 1, 1, 1,
132
- 1, 1, 1, 1, 1, 1, 1, 1,
133
- 1, 1, 1, 1, 1, 1, 1, 1,
134
- 1, 1, 1, 1, 1, 1, 1, 1,
135
- 1, 1, 1, 1, 1, 1, 1, 1,
136
- 1, 1, 1, 1, 1, 1, 1, 1,
137
- 1, 1, 1, 1, 1, 1, 1, 1,
138
- 1, 1, 1, 1, 1, 1, 1, 1,
139
- 1, 1, 1, 1, 1, 1, 1, 1,
140
- 1, 1, 1, 1, 1, 1, 1, 1,
141
- 1, 1, 1, 1, 1, 1, 1, 1,
142
- 1, 1, 1, 1, 1, 1, 1, 1,
143
- 1, 1, 1, 1, 1, 1, 1, 1,
144
- 1, 1, 19, 25, 1, 1, 1, 26,
145
- 1, 1, 1, 1, 1, 1, 1, 1,
146
- 1, 1, 1, 1, 1, 1, 1, 1,
147
- 1, 1, 25, 27, 27, 27, 27, 27,
148
- 27, 27, 28, 1, 27, 27, 27, 27,
149
- 27, 1, 27, 27, 27, 27, 27, 27,
150
- 27, 27, 27, 27, 1, 29, 1, 1,
151
- 1, 1, 1, 27, 27, 27, 27, 27,
152
- 27, 27, 27, 27, 27, 27, 27, 27,
153
- 27, 27, 27, 27, 27, 27, 27, 27,
154
- 27, 27, 27, 27, 27, 1, 1, 1,
155
- 27, 27, 27, 27, 27, 27, 27, 27,
156
- 27, 27, 27, 27, 27, 27, 27, 27,
157
- 27, 27, 27, 27, 27, 27, 27, 27,
158
- 27, 27, 27, 27, 27, 27, 27, 27,
159
- 27, 1, 7, 1, 1, 1, 30, 1,
160
- 1, 1, 1, 1, 1, 1, 1, 1,
161
- 1, 1, 1, 1, 1, 1, 1, 1,
162
- 1, 7, 1, 1, 1, 1, 1, 1,
163
- 1, 31, 1, 1, 1, 1, 1, 1,
164
- 1, 1, 1, 1, 1, 1, 1, 1,
165
- 1, 1, 1, 1, 9, 1, 32, 1,
166
- 1, 1, 33, 1, 1, 1, 1, 1,
167
- 1, 1, 1, 1, 1, 1, 1, 1,
168
- 1, 1, 1, 1, 1, 32, 1, 1,
169
- 1, 1, 1, 1, 1, 34, 1, 1,
170
- 1, 1, 1, 1, 1, 1, 1, 1,
171
- 1, 1, 1, 1, 1, 1, 1, 1,
172
- 35, 1, 9, 1, 1, 1, 36, 1,
173
- 1, 1, 1, 1, 1, 1, 1, 1,
174
- 1, 1, 1, 1, 1, 1, 1, 1,
175
- 1, 9, 1, 1, 1, 1, 1, 1,
176
- 1, 37, 1, 35, 1, 1, 1, 38,
177
- 1, 1, 1, 1, 1, 1, 1, 1,
178
- 1, 1, 1, 1, 1, 1, 1, 1,
179
- 1, 1, 35, 1, 1, 1, 1, 1,
180
- 1, 1, 39, 1, 1, 0
181
- ]
182
-
183
- class << self
184
- attr_accessor :_content_transfer_encoding_trans_targs
185
- private :_content_transfer_encoding_trans_targs, :_content_transfer_encoding_trans_targs=
186
- end
187
- self._content_transfer_encoding_trans_targs = [
188
- 1, 0, 2, 14, 8, 3, 5, 15,
189
- 7, 17, 1, 2, 14, 8, 10, 11,
190
- 10, 19, 13, 10, 11, 10, 19, 13,
191
- 12, 15, 4, 14, 16, 17, 4, 16,
192
- 15, 4, 16, 17, 6, 18, 6, 18
193
- ]
194
-
195
- class << self
196
- attr_accessor :_content_transfer_encoding_trans_actions
197
- private :_content_transfer_encoding_trans_actions, :_content_transfer_encoding_trans_actions=
198
- end
199
- self._content_transfer_encoding_trans_actions = [
200
- 0, 0, 0, 1, 2, 0, 0, 0,
201
- 0, 0, 3, 3, 4, 5, 6, 6,
202
- 7, 8, 6, 0, 0, 2, 9, 0,
203
- 0, 10, 10, 0, 11, 10, 0, 2,
204
- 3, 3, 5, 3, 0, 2, 3, 5
205
- ]
206
-
207
- class << self
208
- attr_accessor :_content_transfer_encoding_eof_actions
209
- private :_content_transfer_encoding_eof_actions, :_content_transfer_encoding_eof_actions=
210
- end
211
- self._content_transfer_encoding_eof_actions = [
212
- 0, 0, 0, 0, 0, 0, 0, 0,
213
- 0, 0, 0, 0, 0, 0, 10, 0,
214
- 3, 0, 3, 0
215
- ]
216
-
217
- class << self
218
- attr_accessor :content_transfer_encoding_start
219
- end
220
- self.content_transfer_encoding_start = 1;
221
- class << self
222
- attr_accessor :content_transfer_encoding_first_final
223
- end
224
- self.content_transfer_encoding_first_final = 14;
225
- class << self
226
- attr_accessor :content_transfer_encoding_error
227
- end
228
- self.content_transfer_encoding_error = 0;
229
-
230
- class << self
231
- attr_accessor :content_transfer_encoding_en_comment_tail
232
- end
233
- self.content_transfer_encoding_en_comment_tail = 9;
234
- class << self
235
- attr_accessor :content_transfer_encoding_en_main
236
- end
237
- self.content_transfer_encoding_en_main = 1;
238
-
239
-
240
- # line 17 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl"
241
-
242
- def self.parse(data)
243
- p = 0
244
- eof = data.length
245
- stack = []
246
-
247
- actions = []
248
- data_unpacked = data.bytes.to_a
249
-
250
- # line 251 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb"
251
- begin
252
- p ||= 0
253
- pe ||= data.length
254
- cs = content_transfer_encoding_start
255
- top = 0
256
- end
257
-
258
- # line 26 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl"
259
-
260
- # line 261 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb"
261
- begin
262
- testEof = false
263
- _slen, _trans, _keys, _inds, _acts, _nacts = nil
264
- _goto_level = 0
265
- _resume = 10
266
- _eof_trans = 15
267
- _again = 20
268
- _test_eof = 30
269
- _out = 40
270
- while true
271
- if _goto_level <= 0
272
- if p == pe
273
- _goto_level = _test_eof
274
- next
275
- end
276
- if cs == 0
277
- _goto_level = _out
278
- next
279
- end
280
- end
281
- if _goto_level <= _resume
282
- _keys = cs << 1
283
- _inds = _content_transfer_encoding_index_offsets[cs]
284
- _slen = _content_transfer_encoding_key_spans[cs]
285
- _trans = if ( _slen > 0 &&
286
- _content_transfer_encoding_trans_keys[_keys] <= ( data_unpacked[p]) &&
287
- ( data_unpacked[p]) <= _content_transfer_encoding_trans_keys[_keys + 1]
288
- ) then
289
- _content_transfer_encoding_indicies[ _inds + ( data_unpacked[p]) - _content_transfer_encoding_trans_keys[_keys] ]
290
- else
291
- _content_transfer_encoding_indicies[ _inds + _slen ]
292
- end
293
- cs = _content_transfer_encoding_trans_targs[_trans]
294
- if _content_transfer_encoding_trans_actions[_trans] != 0
295
- case _content_transfer_encoding_trans_actions[_trans]
296
- when 3 then
297
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
298
- begin
299
- actions.push(4, p) end
300
- when 6 then
301
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
302
- begin
303
- actions.push(5, p) end
304
- when 10 then
305
- # line 17 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
306
- begin
307
- actions.push(14, p) end
308
- when 1 then
309
- # line 18 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
310
- begin
311
- actions.push(15, p) end
312
- when 2 then
313
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
314
- begin
315
- begin
316
- stack[top] = cs
317
- top+= 1
318
- cs = 9
319
- _goto_level = _again
320
- next
321
- end
322
- end
323
- when 9 then
324
- # line 6 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
325
- begin
326
- begin
327
- top -= 1
328
- cs = stack[top]
329
- _goto_level = _again
330
- next
331
- end
332
- end
333
- when 4 then
334
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
335
- begin
336
- actions.push(4, p) end
337
- # line 18 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
338
- begin
339
- actions.push(15, p) end
340
- when 5 then
341
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
342
- begin
343
- actions.push(4, p) end
344
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
345
- begin
346
- begin
347
- stack[top] = cs
348
- top+= 1
349
- cs = 9
350
- _goto_level = _again
351
- next
352
- end
353
- end
354
- when 7 then
355
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
356
- begin
357
- actions.push(5, p) end
358
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
359
- begin
360
- begin
361
- stack[top] = cs
362
- top+= 1
363
- cs = 9
364
- _goto_level = _again
365
- next
366
- end
367
- end
368
- when 8 then
369
- # line 8 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
370
- begin
371
- actions.push(5, p) end
372
- # line 6 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
373
- begin
374
- begin
375
- top -= 1
376
- cs = stack[top]
377
- _goto_level = _again
378
- next
379
- end
380
- end
381
- when 11 then
382
- # line 17 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
383
- begin
384
- actions.push(14, p) end
385
- # line 5 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/../../common.rl"
386
- begin
387
- begin
388
- stack[top] = cs
389
- top+= 1
390
- cs = 9
391
- _goto_level = _again
392
- next
393
- end
394
- end
395
- # line 396 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb"
396
- end
397
- end
398
- end
399
- if _goto_level <= _again
400
- if cs == 0
401
- _goto_level = _out
402
- next
403
- end
404
- p += 1
405
- if p != pe
406
- _goto_level = _resume
407
- next
408
- end
409
- end
410
- if _goto_level <= _test_eof
411
- if p == eof
412
- case _content_transfer_encoding_eof_actions[cs]
413
- when 3 then
414
- # line 7 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
415
- begin
416
- actions.push(4, p) end
417
- when 10 then
418
- # line 17 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl"
419
- begin
420
- actions.push(14, p) end
421
- # line 422 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb"
422
- end
423
- end
424
-
425
- end
426
- if _goto_level <= _out
427
- break
428
- end
429
- end
430
- end
431
-
432
- # line 27 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl"
433
-
434
- if p == eof && cs >=
435
- # line 436 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb"
436
- 14
437
- # line 28 "/home/bpot/src/gh/bpot/mail/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl"
438
-
439
- return actions, nil
440
- else
441
- return [], "Only able to parse up to #{data[0..p]}"
442
- end
443
- end
444
- end
445
- end
446
- end
447
- end
@@ -1,37 +0,0 @@
1
- %%{
2
- machine content_transfer_encoding;
3
-
4
- include rb_actions "rb_actions.rl";
5
- include common "../../common.rl";
6
-
7
- getkey data_unpacked[p];
8
-
9
- main := content_transfer_encoding;
10
- }%%
11
-
12
- module Mail
13
- module Parsers
14
- module Ragel
15
- module ContentTransferEncodingMachine
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