mail 2.6.6 → 2.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +5 -5
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +74 -90
  4. data/lib/mail/attachments_list.rb +8 -4
  5. data/lib/mail/body.rb +50 -38
  6. data/lib/mail/check_delivery_params.rb +8 -6
  7. data/lib/mail/configuration.rb +2 -0
  8. data/lib/mail/constants.rb +1 -1
  9. data/lib/mail/core_extensions/smtp.rb +19 -16
  10. data/lib/mail/core_extensions/string.rb +0 -4
  11. data/lib/mail/elements/address.rb +28 -22
  12. data/lib/mail/elements/address_list.rb +10 -18
  13. data/lib/mail/elements/content_disposition_element.rb +8 -15
  14. data/lib/mail/elements/content_location_element.rb +5 -10
  15. data/lib/mail/elements/content_transfer_encoding_element.rb +5 -10
  16. data/lib/mail/elements/content_type_element.rb +8 -19
  17. data/lib/mail/elements/date_time_element.rb +6 -14
  18. data/lib/mail/elements/envelope_from_element.rb +14 -21
  19. data/lib/mail/elements/message_ids_element.rb +8 -12
  20. data/lib/mail/elements/mime_version_element.rb +6 -14
  21. data/lib/mail/elements/phrase_list.rb +6 -9
  22. data/lib/mail/elements/received_element.rb +9 -15
  23. data/lib/mail/encodings/7bit.rb +5 -15
  24. data/lib/mail/encodings/8bit.rb +2 -21
  25. data/lib/mail/encodings/base64.rb +11 -12
  26. data/lib/mail/encodings/binary.rb +3 -22
  27. data/lib/mail/encodings/identity.rb +24 -0
  28. data/lib/mail/encodings/quoted_printable.rb +6 -6
  29. data/lib/mail/encodings/transfer_encoding.rb +38 -29
  30. data/lib/mail/encodings/unix_to_unix.rb +3 -1
  31. data/lib/mail/encodings.rb +99 -43
  32. data/lib/mail/envelope.rb +1 -1
  33. data/lib/mail/field.rb +96 -59
  34. data/lib/mail/fields/bcc_field.rb +2 -2
  35. data/lib/mail/fields/cc_field.rb +1 -1
  36. data/lib/mail/fields/comments_field.rb +1 -1
  37. data/lib/mail/fields/common/common_address.rb +32 -7
  38. data/lib/mail/fields/common/common_field.rb +1 -10
  39. data/lib/mail/fields/common/parameter_hash.rb +1 -1
  40. data/lib/mail/fields/content_description_field.rb +1 -1
  41. data/lib/mail/fields/content_disposition_field.rb +3 -3
  42. data/lib/mail/fields/content_id_field.rb +2 -2
  43. data/lib/mail/fields/content_location_field.rb +1 -1
  44. data/lib/mail/fields/content_transfer_encoding_field.rb +1 -1
  45. data/lib/mail/fields/content_type_field.rb +4 -9
  46. data/lib/mail/fields/date_field.rb +2 -3
  47. data/lib/mail/fields/from_field.rb +1 -1
  48. data/lib/mail/fields/in_reply_to_field.rb +1 -1
  49. data/lib/mail/fields/keywords_field.rb +1 -1
  50. data/lib/mail/fields/message_id_field.rb +1 -1
  51. data/lib/mail/fields/mime_version_field.rb +1 -1
  52. data/lib/mail/fields/optional_field.rb +4 -1
  53. data/lib/mail/fields/received_field.rb +1 -1
  54. data/lib/mail/fields/references_field.rb +1 -1
  55. data/lib/mail/fields/reply_to_field.rb +1 -1
  56. data/lib/mail/fields/resent_bcc_field.rb +1 -1
  57. data/lib/mail/fields/resent_cc_field.rb +1 -1
  58. data/lib/mail/fields/resent_date_field.rb +0 -1
  59. data/lib/mail/fields/resent_from_field.rb +1 -1
  60. data/lib/mail/fields/resent_message_id_field.rb +1 -1
  61. data/lib/mail/fields/resent_sender_field.rb +1 -1
  62. data/lib/mail/fields/resent_to_field.rb +1 -1
  63. data/lib/mail/fields/return_path_field.rb +1 -1
  64. data/lib/mail/fields/sender_field.rb +1 -1
  65. data/lib/mail/fields/subject_field.rb +1 -1
  66. data/lib/mail/fields/to_field.rb +1 -1
  67. data/lib/mail/fields/unstructured_field.rb +21 -4
  68. data/lib/mail/header.rb +10 -8
  69. data/lib/mail/mail.rb +2 -10
  70. data/lib/mail/matchers/has_sent_mail.rb +21 -1
  71. data/lib/mail/message.rb +78 -68
  72. data/lib/mail/multibyte/chars.rb +29 -28
  73. data/lib/mail/multibyte/unicode.rb +10 -10
  74. data/lib/mail/multibyte.rb +64 -15
  75. data/lib/mail/network/delivery_methods/logger_delivery.rb +37 -0
  76. data/lib/mail/network/delivery_methods/sendmail.rb +8 -5
  77. data/lib/mail/network/delivery_methods/smtp.rb +58 -49
  78. data/lib/mail/network/delivery_methods/smtp_connection.rb +9 -1
  79. data/lib/mail/network/retriever_methods/imap.rb +18 -5
  80. data/lib/mail/network/retriever_methods/pop3.rb +3 -1
  81. data/lib/mail/network.rb +1 -0
  82. data/lib/mail/parser_tools.rb +15 -0
  83. data/lib/mail/parsers/address_lists_parser.rb +33207 -104
  84. data/lib/mail/parsers/address_lists_parser.rl +172 -0
  85. data/lib/mail/parsers/content_disposition_parser.rb +876 -49
  86. data/lib/mail/parsers/content_disposition_parser.rl +82 -0
  87. data/lib/mail/parsers/content_location_parser.rb +803 -23
  88. data/lib/mail/parsers/content_location_parser.rl +71 -0
  89. data/lib/mail/parsers/content_transfer_encoding_parser.rb +501 -19
  90. data/lib/mail/parsers/content_transfer_encoding_parser.rl +64 -0
  91. data/lib/mail/parsers/content_type_parser.rb +1023 -48
  92. data/lib/mail/parsers/content_type_parser.rl +83 -0
  93. data/lib/mail/parsers/date_time_parser.rb +870 -24
  94. data/lib/mail/parsers/date_time_parser.rl +62 -0
  95. data/lib/mail/parsers/envelope_from_parser.rb +3569 -34
  96. data/lib/mail/parsers/envelope_from_parser.rl +82 -0
  97. data/lib/mail/parsers/message_ids_parser.rb +2839 -25
  98. data/lib/mail/parsers/message_ids_parser.rl +82 -0
  99. data/lib/mail/parsers/mime_version_parser.rb +491 -26
  100. data/lib/mail/parsers/mime_version_parser.rl +61 -0
  101. data/lib/mail/parsers/phrase_lists_parser.rb +860 -18
  102. data/lib/mail/parsers/phrase_lists_parser.rl +83 -0
  103. data/lib/mail/parsers/received_parser.rb +8764 -37
  104. data/lib/mail/parsers/received_parser.rl +84 -0
  105. data/lib/mail/parsers/rfc2045_content_transfer_encoding.rl +13 -0
  106. data/lib/mail/parsers/rfc2045_content_type.rl +25 -0
  107. data/lib/mail/parsers/rfc2045_mime.rl +16 -0
  108. data/lib/mail/parsers/rfc2183_content_disposition.rl +15 -0
  109. data/lib/mail/parsers/rfc3629_utf8.rl +19 -0
  110. data/lib/mail/parsers/rfc5234_abnf_core_rules.rl +22 -0
  111. data/lib/mail/parsers/rfc5322.rl +59 -0
  112. data/lib/mail/parsers/rfc5322_address.rl +72 -0
  113. data/lib/mail/parsers/{ragel/date_time.rl → rfc5322_date_time.rl} +8 -1
  114. data/lib/mail/parsers/rfc5322_lexical_tokens.rl +60 -0
  115. data/lib/mail/parsers.rb +16 -24
  116. data/lib/mail/part.rb +3 -3
  117. data/lib/mail/parts_list.rb +5 -6
  118. data/lib/mail/utilities.rb +59 -28
  119. data/lib/mail/version.rb +2 -2
  120. data/lib/mail/version_specific/ruby_1_8.rb +40 -3
  121. data/lib/mail/version_specific/ruby_1_9.rb +61 -9
  122. data/lib/mail.rb +3 -16
  123. metadata +44 -53
  124. data/CHANGELOG.rdoc +0 -803
  125. data/CONTRIBUTING.md +0 -60
  126. data/Dependencies.txt +0 -2
  127. data/Gemfile +0 -14
  128. data/Rakefile +0 -29
  129. data/TODO.rdoc +0 -9
  130. data/lib/mail/core_extensions/string/access.rb +0 -146
  131. data/lib/mail/core_extensions/string/multibyte.rb +0 -79
  132. data/lib/mail/multibyte/exceptions.rb +0 -9
  133. data/lib/mail/parsers/ragel/common.rl +0 -185
  134. data/lib/mail/parsers/ragel/parser_info.rb +0 -61
  135. data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb +0 -14864
  136. data/lib/mail/parsers/ragel/ruby/machines/address_lists_machine.rb.rl +0 -37
  137. data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb +0 -751
  138. data/lib/mail/parsers/ragel/ruby/machines/content_disposition_machine.rb.rl +0 -37
  139. data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb +0 -614
  140. data/lib/mail/parsers/ragel/ruby/machines/content_location_machine.rb.rl +0 -37
  141. data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb +0 -447
  142. data/lib/mail/parsers/ragel/ruby/machines/content_transfer_encoding_machine.rb.rl +0 -37
  143. data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb +0 -825
  144. data/lib/mail/parsers/ragel/ruby/machines/content_type_machine.rb.rl +0 -37
  145. data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb +0 -817
  146. data/lib/mail/parsers/ragel/ruby/machines/date_time_machine.rb.rl +0 -37
  147. data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb +0 -2149
  148. data/lib/mail/parsers/ragel/ruby/machines/envelope_from_machine.rb.rl +0 -37
  149. data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb +0 -1570
  150. data/lib/mail/parsers/ragel/ruby/machines/message_ids_machine.rb.rl +0 -37
  151. data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb +0 -440
  152. data/lib/mail/parsers/ragel/ruby/machines/mime_version_machine.rb.rl +0 -37
  153. data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb +0 -564
  154. data/lib/mail/parsers/ragel/ruby/machines/phrase_lists_machine.rb.rl +0 -37
  155. data/lib/mail/parsers/ragel/ruby/machines/rb_actions.rl +0 -51
  156. data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb +0 -5144
  157. data/lib/mail/parsers/ragel/ruby/machines/received_machine.rb.rl +0 -37
  158. data/lib/mail/parsers/ragel/ruby/parser.rb.rl.erb +0 -37
  159. data/lib/mail/parsers/ragel/ruby.rb +0 -40
  160. data/lib/mail/parsers/ragel.rb +0 -18
@@ -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