tmail 1.2.3.1 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. data/README +10 -0
  2. data/ext/tmailscanner/tmail/tmailscanner.c +39 -8
  3. data/lib/tmail.rb +1 -0
  4. data/lib/tmail/address.rb +6 -40
  5. data/lib/tmail/attachments.rb +41 -22
  6. data/lib/tmail/encode.rb +9 -0
  7. data/lib/tmail/header.rb +5 -3
  8. data/lib/tmail/interface.rb +40 -3
  9. data/lib/tmail/mail.rb +3 -3
  10. data/lib/tmail/mailbox.rb +3 -2
  11. data/lib/tmail/net.rb +3 -1
  12. data/lib/tmail/parser.rb +204 -620
  13. data/lib/tmail/parser.y +38 -3
  14. data/lib/tmail/quoting.rb +38 -1
  15. data/lib/tmail/utils.rb +28 -4
  16. data/lib/tmail/vendor/rchardet-1.3/COPYING +504 -0
  17. data/lib/tmail/vendor/rchardet-1.3/README +12 -0
  18. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet.rb +67 -0
  19. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/big5freq.rb +927 -0
  20. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/big5prober.rb +42 -0
  21. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/chardistribution.rb +237 -0
  22. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/charsetgroupprober.rb +112 -0
  23. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/charsetprober.rb +75 -0
  24. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/codingstatemachine.rb +64 -0
  25. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/constants.rb +42 -0
  26. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/escprober.rb +90 -0
  27. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/escsm.rb +244 -0
  28. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/eucjpprober.rb +88 -0
  29. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/euckrfreq.rb +596 -0
  30. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/euckrprober.rb +42 -0
  31. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/euctwfreq.rb +430 -0
  32. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/euctwprober.rb +42 -0
  33. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/gb2312freq.rb +474 -0
  34. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/gb2312prober.rb +42 -0
  35. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/hebrewprober.rb +289 -0
  36. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/jisfreq.rb +570 -0
  37. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/jpcntx.rb +229 -0
  38. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langbulgarianmodel.rb +229 -0
  39. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langcyrillicmodel.rb +330 -0
  40. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langgreekmodel.rb +227 -0
  41. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langhebrewmodel.rb +202 -0
  42. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langhungarianmodel.rb +226 -0
  43. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/langthaimodel.rb +201 -0
  44. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/latin1prober.rb +147 -0
  45. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/mbcharsetprober.rb +89 -0
  46. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/mbcsgroupprober.rb +47 -0
  47. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/mbcssm.rb +542 -0
  48. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/sbcharsetprober.rb +124 -0
  49. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/sbcsgroupprober.rb +58 -0
  50. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/sjisprober.rb +88 -0
  51. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/universaldetector.rb +166 -0
  52. data/lib/tmail/vendor/rchardet-1.3/lib/rchardet/utf8prober.rb +87 -0
  53. data/lib/tmail/version.rb +1 -1
  54. data/setup.rb +2 -2
  55. data/test/fixtures/apple_unquoted_content_type +44 -0
  56. data/test/fixtures/inline_attachment.txt +2095 -0
  57. data/test/fixtures/iso_8859_1_email_without_encoding_and_message_id.txt +16 -0
  58. data/test/fixtures/mailbox.zip +0 -0
  59. data/test/fixtures/marked_as_iso_8859_1_but_it_is_utf_8.txt +33 -0
  60. data/test/fixtures/marked_as_utf_8_but_it_is_iso_8859_1.txt +56 -0
  61. data/test/fixtures/raw_email_bad_time +62 -0
  62. data/test/fixtures/raw_email_double_at_in_header +14 -0
  63. data/test/fixtures/raw_email_only_attachment +17 -0
  64. data/test/fixtures/raw_email_string_in_date_field +17 -0
  65. data/test/fixtures/raw_email_trailing_dot +21 -0
  66. data/test/fixtures/raw_email_with_quoted_attachment_filename +60 -0
  67. data/test/fixtures/raw_email_with_wrong_splitted_multibyte_encoded_word_subject +15 -0
  68. data/test/fixtures/the_only_part_is_a_word_document.txt +425 -0
  69. data/test/fixtures/unquoted_filename_in_attachment +177 -0
  70. data/test/test_address.rb +114 -92
  71. data/test/test_attachments.rb +84 -1
  72. data/test/test_encode.rb +54 -0
  73. data/test/test_header.rb +60 -2
  74. data/test/test_mail.rb +22 -15
  75. data/test/test_mbox.rb +12 -3
  76. data/test/test_port.rb +13 -9
  77. data/test/test_quote.rb +9 -0
  78. data/tmail.gemspec +34 -0
  79. metadata +68 -167
  80. data/MANIFEST +0 -191
  81. data/log/BugTrackingLog.txt +0 -1231
  82. data/log/Changelog.txt +0 -534
  83. data/log/Fixme.txt +0 -6
  84. data/log/Testlog.txt +0 -2340
  85. data/log/Todo.txt +0 -30
  86. data/log/fixme.rdoc +0 -6
  87. data/meta/MANIFEST +0 -128
  88. data/meta/VERSION +0 -1
  89. data/meta/project.yaml +0 -30
  90. data/meta/unixname +0 -1
  91. data/sample/bench_base64.rb +0 -48
  92. data/sample/data/multipart +0 -23
  93. data/sample/data/normal +0 -29
  94. data/sample/data/sendtest +0 -5
  95. data/sample/data/simple +0 -14
  96. data/sample/data/test +0 -27
  97. data/sample/extract-attachements.rb +0 -33
  98. data/sample/from-check.rb +0 -26
  99. data/sample/multipart.rb +0 -26
  100. data/sample/parse-bench.rb +0 -68
  101. data/sample/parse-test.rb +0 -19
  102. data/sample/sendmail.rb +0 -94
  103. data/site/contributing/index.html +0 -183
  104. data/site/css/clean.css +0 -27
  105. data/site/css/layout.css +0 -31
  106. data/site/css/style.css +0 -60
  107. data/site/download/index.html +0 -61
  108. data/site/img/envelope.jpg +0 -0
  109. data/site/img/mailman.gif +0 -0
  110. data/site/img/stamp-sm.jpg +0 -0
  111. data/site/img/stamp.jpg +0 -0
  112. data/site/img/stampborder.jpg +0 -0
  113. data/site/img/tfire.jpg +0 -0
  114. data/site/img/tmail.png +0 -0
  115. data/site/index.html +0 -270
  116. data/site/js/jquery.js +0 -31
  117. data/site/log/Changelog.xsl +0 -33
  118. data/site/log/changelog.xml +0 -1677
  119. data/site/outdated/BUGS +0 -3
  120. data/site/outdated/DEPENDS +0 -1
  121. data/site/outdated/Incompatibilities +0 -89
  122. data/site/outdated/Incompatibilities.ja +0 -102
  123. data/site/outdated/NEWS +0 -9
  124. data/site/outdated/README.ja +0 -73
  125. data/site/outdated/doc.ja/address.html +0 -275
  126. data/site/outdated/doc.ja/basics.html +0 -405
  127. data/site/outdated/doc.ja/config.html +0 -49
  128. data/site/outdated/doc.ja/details.html +0 -146
  129. data/site/outdated/doc.ja/index.html +0 -39
  130. data/site/outdated/doc.ja/mail.html +0 -793
  131. data/site/outdated/doc.ja/mailbox.html +0 -265
  132. data/site/outdated/doc.ja/port.html +0 -95
  133. data/site/outdated/doc.ja/tmail.html +0 -58
  134. data/site/outdated/doc.ja/usage.html +0 -202
  135. data/site/outdated/rdd/address.rrd.m +0 -229
  136. data/site/outdated/rdd/basics.rd.m +0 -275
  137. data/site/outdated/rdd/config.rrd.m +0 -26
  138. data/site/outdated/rdd/details.rd.m +0 -117
  139. data/site/outdated/rdd/index.rhtml.m +0 -54
  140. data/site/outdated/rdd/mail.rrd.m +0 -701
  141. data/site/outdated/rdd/mailbox.rrd.m +0 -228
  142. data/site/outdated/rdd/port.rrd.m +0 -69
  143. data/site/outdated/rdd/tmail.rrd.m +0 -33
  144. data/site/outdated/rdd/usage.rd.m +0 -247
  145. data/site/quickstart/index.html +0 -69
  146. data/site/quickstart/quickstart.html +0 -52
  147. data/site/quickstart/usage.html +0 -193
  148. data/site/reference/address.html +0 -247
  149. data/site/reference/config.html +0 -30
  150. data/site/reference/index.html +0 -101
  151. data/site/reference/mail.html +0 -726
  152. data/site/reference/mailbox.html +0 -245
  153. data/site/reference/port.html +0 -75
  154. data/site/reference/tmail.html +0 -35
  155. data/work/script/make +0 -26
  156. data/work/script/rdoc +0 -39
  157. data/work/script/setup +0 -1616
  158. data/work/script/test +0 -30
@@ -364,9 +364,10 @@ module TMail
364
364
  end
365
365
 
366
366
  def fromline2time( line )
367
- m = /\AFrom \S+ \w+ (\w+) (\d+) (\d+):(\d+):(\d+) (\d+)/.match(line) \
368
- or return nil
367
+ m = /\AFrom \S+ \w+ (\w+) (\d+) (\d+):(\d+):(\d+) (\d+)/.match(line) or return nil
369
368
  Time.local(m[6].to_i, m[1], m[2].to_i, m[3].to_i, m[4].to_i, m[5].to_i)
369
+ rescue
370
+ nil
370
371
  end
371
372
 
372
373
  end # UNIXMbox
@@ -78,7 +78,9 @@ module TMail
78
78
  end
79
79
 
80
80
  def add_message_id( fqdn = nil )
81
- self.message_id = ::TMail::new_message_id(fqdn)
81
+ unless @message_id_enforced
82
+ self.message_id = ::TMail::new_message_id(fqdn)
83
+ end
82
84
  end
83
85
 
84
86
  def add_date
@@ -1,461 +1,10 @@
1
- #:stopdoc:
1
+ #
2
2
  # DO NOT MODIFY!!!!
3
3
  # This file is automatically generated by racc 1.4.5
4
- # from racc grammer file "parser.y".
5
- #
6
- #
7
- # parser.rb: generated by racc (runtime embedded)
8
- #
9
- ###### racc/parser.rb begin
10
- unless $".index 'racc/parser.rb'
11
- $".push 'racc/parser.rb'
12
-
13
- self.class.module_eval <<'..end racc/parser.rb modeval..id8076474214', 'racc/parser.rb', 1
14
- #
15
- # $Id: parser.rb,v 1.7 2005/11/20 17:31:32 aamine Exp $
4
+ # from racc grammer file "lib/tmail/parser.y".
16
5
  #
17
- # Copyright (c) 1999-2005 Minero Aoki
18
- #
19
- # This program is free software.
20
- # You can distribute/modify this program under the same terms of ruby.
21
- #
22
- # As a special exception, when this code is copied by Racc
23
- # into a Racc output file, you may use that output file
24
- # without restriction.
25
- #
26
-
27
- unless defined?(NotImplementedError)
28
- NotImplementedError = NotImplementError
29
- end
30
-
31
- module Racc
32
- class ParseError < StandardError; end
33
- end
34
- unless defined?(::ParseError)
35
- ParseError = Racc::ParseError
36
- end
37
-
38
- module Racc
39
-
40
- unless defined?(Racc_No_Extentions)
41
- Racc_No_Extentions = false
42
- end
43
-
44
- class Parser
45
-
46
- Racc_Runtime_Version = '1.4.5'
47
- Racc_Runtime_Revision = '$Revision: 1.7 $'.split[1]
48
-
49
- Racc_Runtime_Core_Version_R = '1.4.5'
50
- Racc_Runtime_Core_Revision_R = '$Revision: 1.7 $'.split[1]
51
- begin
52
- require 'racc/cparse'
53
- # Racc_Runtime_Core_Version_C = (defined in extention)
54
- Racc_Runtime_Core_Revision_C = Racc_Runtime_Core_Id_C.split[2]
55
- unless new.respond_to?(:_racc_do_parse_c, true)
56
- raise LoadError, 'old cparse.so'
57
- end
58
- if Racc_No_Extentions
59
- raise LoadError, 'selecting ruby version of racc runtime core'
60
- end
61
-
62
- Racc_Main_Parsing_Routine = :_racc_do_parse_c
63
- Racc_YY_Parse_Method = :_racc_yyparse_c
64
- Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_C
65
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_C
66
- Racc_Runtime_Type = 'c'
67
- rescue LoadError
68
- Racc_Main_Parsing_Routine = :_racc_do_parse_rb
69
- Racc_YY_Parse_Method = :_racc_yyparse_rb
70
- Racc_Runtime_Core_Version = Racc_Runtime_Core_Version_R
71
- Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_R
72
- Racc_Runtime_Type = 'ruby'
73
- end
74
-
75
- def Parser.racc_runtime_type
76
- Racc_Runtime_Type
77
- end
78
-
79
- private
80
-
81
- def _racc_setup
82
- @yydebug = false unless self.class::Racc_debug_parser
83
- @yydebug = false unless defined?(@yydebug)
84
- if @yydebug
85
- @racc_debug_out = $stderr unless defined?(@racc_debug_out)
86
- @racc_debug_out ||= $stderr
87
- end
88
- arg = self.class::Racc_arg
89
- arg[13] = true if arg.size < 14
90
- arg
91
- end
92
-
93
- def _racc_init_sysvars
94
- @racc_state = [0]
95
- @racc_tstack = []
96
- @racc_vstack = []
97
-
98
- @racc_t = nil
99
- @racc_val = nil
100
-
101
- @racc_read_next = true
102
-
103
- @racc_user_yyerror = false
104
- @racc_error_status = 0
105
- end
106
6
 
107
- ###
108
- ### do_parse
109
- ###
110
-
111
- def do_parse
112
- __send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
113
- end
114
-
115
- def next_token
116
- raise NotImplementedError, "#{self.class}\#next_token is not defined"
117
- end
118
-
119
- def _racc_do_parse_rb(arg, in_debug)
120
- action_table, action_check, action_default, action_pointer,
121
- goto_table, goto_check, goto_default, goto_pointer,
122
- nt_base, reduce_table, token_table, shift_n,
123
- reduce_n, use_result, * = arg
124
-
125
- _racc_init_sysvars
126
- tok = act = i = nil
127
- nerr = 0
128
-
129
- catch(:racc_end_parse) {
130
- while true
131
- if i = action_pointer[@racc_state[-1]]
132
- if @racc_read_next
133
- if @racc_t != 0 # not EOF
134
- tok, @racc_val = next_token()
135
- unless tok # EOF
136
- @racc_t = 0
137
- else
138
- @racc_t = (token_table[tok] or 1) # error token
139
- end
140
- racc_read_token(@racc_t, tok, @racc_val) if @yydebug
141
- @racc_read_next = false
142
- end
143
- end
144
- i += @racc_t
145
- unless i >= 0 and
146
- act = action_table[i] and
147
- action_check[i] == @racc_state[-1]
148
- act = action_default[@racc_state[-1]]
149
- end
150
- else
151
- act = action_default[@racc_state[-1]]
152
- end
153
- while act = _racc_evalact(act, arg)
154
- ;
155
- end
156
- end
157
- }
158
- end
159
-
160
- ###
161
- ### yyparse
162
- ###
163
-
164
- def yyparse(recv, mid)
165
- __send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), true)
166
- end
167
-
168
- def _racc_yyparse_rb(recv, mid, arg, c_debug)
169
- action_table, action_check, action_default, action_pointer,
170
- goto_table, goto_check, goto_default, goto_pointer,
171
- nt_base, reduce_table, token_table, shift_n,
172
- reduce_n, use_result, * = arg
173
-
174
- _racc_init_sysvars
175
- tok = nil
176
- act = nil
177
- i = nil
178
- nerr = 0
179
-
180
- catch(:racc_end_parse) {
181
- until i = action_pointer[@racc_state[-1]]
182
- while act = _racc_evalact(action_default[@racc_state[-1]], arg)
183
- ;
184
- end
185
- end
186
- recv.__send__(mid) do |tok, val|
187
- unless tok
188
- @racc_t = 0
189
- else
190
- @racc_t = (token_table[tok] or 1) # error token
191
- end
192
- @racc_val = val
193
- @racc_read_next = false
194
-
195
- i += @racc_t
196
- unless i >= 0 and
197
- act = action_table[i] and
198
- action_check[i] == @racc_state[-1]
199
- act = action_default[@racc_state[-1]]
200
- end
201
- while act = _racc_evalact(act, arg)
202
- ;
203
- end
204
-
205
- while not (i = action_pointer[@racc_state[-1]]) or
206
- not @racc_read_next or
207
- @racc_t == 0 # $
208
- unless i and i += @racc_t and
209
- i >= 0 and
210
- act = action_table[i] and
211
- action_check[i] == @racc_state[-1]
212
- act = action_default[@racc_state[-1]]
213
- end
214
- while act = _racc_evalact(act, arg)
215
- ;
216
- end
217
- end
218
- end
219
- }
220
- end
221
-
222
- ###
223
- ### common
224
- ###
225
-
226
- def _racc_evalact(act, arg)
227
- action_table, action_check, action_default, action_pointer,
228
- goto_table, goto_check, goto_default, goto_pointer,
229
- nt_base, reduce_table, token_table, shift_n,
230
- reduce_n, use_result, * = arg
231
- nerr = 0 # tmp
232
-
233
- if act > 0 and act < shift_n
234
- #
235
- # shift
236
- #
237
- if @racc_error_status > 0
238
- @racc_error_status -= 1 unless @racc_t == 1 # error token
239
- end
240
- @racc_vstack.push @racc_val
241
- @racc_state.push act
242
- @racc_read_next = true
243
- if @yydebug
244
- @racc_tstack.push @racc_t
245
- racc_shift @racc_t, @racc_tstack, @racc_vstack
246
- end
247
-
248
- elsif act < 0 and act > -reduce_n
249
- #
250
- # reduce
251
- #
252
- code = catch(:racc_jump) {
253
- @racc_state.push _racc_do_reduce(arg, act)
254
- false
255
- }
256
- if code
257
- case code
258
- when 1 # yyerror
259
- @racc_user_yyerror = true # user_yyerror
260
- return -reduce_n
261
- when 2 # yyaccept
262
- return shift_n
263
- else
264
- raise '[Racc Bug] unknown jump code'
265
- end
266
- end
267
-
268
- elsif act == shift_n
269
- #
270
- # accept
271
- #
272
- racc_accept if @yydebug
273
- throw :racc_end_parse, @racc_vstack[0]
274
-
275
- elsif act == -reduce_n
276
- #
277
- # error
278
- #
279
- case @racc_error_status
280
- when 0
281
- unless arg[21] # user_yyerror
282
- nerr += 1
283
- on_error @racc_t, @racc_val, @racc_vstack
284
- end
285
- when 3
286
- if @racc_t == 0 # is $
287
- throw :racc_end_parse, nil
288
- end
289
- @racc_read_next = true
290
- end
291
- @racc_user_yyerror = false
292
- @racc_error_status = 3
293
- while true
294
- if i = action_pointer[@racc_state[-1]]
295
- i += 1 # error token
296
- if i >= 0 and
297
- (act = action_table[i]) and
298
- action_check[i] == @racc_state[-1]
299
- break
300
- end
301
- end
302
- throw :racc_end_parse, nil if @racc_state.size <= 1
303
- @racc_state.pop
304
- @racc_vstack.pop
305
- if @yydebug
306
- @racc_tstack.pop
307
- racc_e_pop @racc_state, @racc_tstack, @racc_vstack
308
- end
309
- end
310
- return act
311
-
312
- else
313
- raise "[Racc Bug] unknown action #{act.inspect}"
314
- end
315
-
316
- racc_next_state(@racc_state[-1], @racc_state) if @yydebug
317
-
318
- nil
319
- end
320
-
321
- def _racc_do_reduce(arg, act)
322
- action_table, action_check, action_default, action_pointer,
323
- goto_table, goto_check, goto_default, goto_pointer,
324
- nt_base, reduce_table, token_table, shift_n,
325
- reduce_n, use_result, * = arg
326
- state = @racc_state
327
- vstack = @racc_vstack
328
- tstack = @racc_tstack
329
-
330
- i = act * -3
331
- len = reduce_table[i]
332
- reduce_to = reduce_table[i+1]
333
- method_id = reduce_table[i+2]
334
- void_array = []
335
-
336
- tmp_t = tstack[-len, len] if @yydebug
337
- tmp_v = vstack[-len, len]
338
- tstack[-len, len] = void_array if @yydebug
339
- vstack[-len, len] = void_array
340
- state[-len, len] = void_array
341
-
342
- # tstack must be updated AFTER method call
343
- if use_result
344
- vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
345
- else
346
- vstack.push __send__(method_id, tmp_v, vstack)
347
- end
348
- tstack.push reduce_to
349
-
350
- racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug
351
-
352
- k1 = reduce_to - nt_base
353
- if i = goto_pointer[k1]
354
- i += state[-1]
355
- if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
356
- return curstate
357
- end
358
- end
359
- goto_default[k1]
360
- end
361
-
362
- def on_error(t, val, vstack)
363
- raise ParseError, sprintf("\nparse error on value %s (%s)",
364
- val.inspect, token_to_str(t) || '?')
365
- end
366
-
367
- def yyerror
368
- throw :racc_jump, 1
369
- end
370
-
371
- def yyaccept
372
- throw :racc_jump, 2
373
- end
374
-
375
- def yyerrok
376
- @racc_error_status = 0
377
- end
378
-
379
- #
380
- # for debugging output
381
- #
382
-
383
- def racc_read_token(t, tok, val)
384
- @racc_debug_out.print 'read '
385
- @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
386
- @racc_debug_out.puts val.inspect
387
- @racc_debug_out.puts
388
- end
389
-
390
- def racc_shift(tok, tstack, vstack)
391
- @racc_debug_out.puts "shift #{racc_token2str tok}"
392
- racc_print_stacks tstack, vstack
393
- @racc_debug_out.puts
394
- end
395
-
396
- def racc_reduce(toks, sim, tstack, vstack)
397
- out = @racc_debug_out
398
- out.print 'reduce '
399
- if toks.empty?
400
- out.print ' <none>'
401
- else
402
- toks.each {|t| out.print ' ', racc_token2str(t) }
403
- end
404
- out.puts " --> #{racc_token2str(sim)}"
405
-
406
- racc_print_stacks tstack, vstack
407
- @racc_debug_out.puts
408
- end
409
-
410
- def racc_accept
411
- @racc_debug_out.puts 'accept'
412
- @racc_debug_out.puts
413
- end
414
-
415
- def racc_e_pop(state, tstack, vstack)
416
- @racc_debug_out.puts 'error recovering mode: pop token'
417
- racc_print_states state
418
- racc_print_stacks tstack, vstack
419
- @racc_debug_out.puts
420
- end
421
-
422
- def racc_next_state(curstate, state)
423
- @racc_debug_out.puts "goto #{curstate}"
424
- racc_print_states state
425
- @racc_debug_out.puts
426
- end
427
-
428
- def racc_print_stacks(t, v)
429
- out = @racc_debug_out
430
- out.print ' ['
431
- t.each_index do |i|
432
- out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
433
- end
434
- out.puts ' ]'
435
- end
436
-
437
- def racc_print_states(s)
438
- out = @racc_debug_out
439
- out.print ' ['
440
- s.each {|st| out.print ' ', st }
441
- out.puts ' ]'
442
- end
443
-
444
- def racc_token2str(tok)
445
- self.class::Racc_token_to_s_table[tok] or
446
- raise "[Racc Bug] can't convert token #{tok} to string"
447
- end
448
-
449
- def token_to_str(t)
450
- self.class::Racc_token_to_s_table[t]
451
- end
452
-
453
- end
454
-
455
- end
456
- ..end racc/parser.rb modeval..id8076474214
457
- end
458
- ###### racc/parser.rb end
7
+ require 'racc/parser'
459
8
 
460
9
 
461
10
  #
@@ -476,14 +25,49 @@ module TMail
476
25
 
477
26
  class Parser < Racc::Parser
478
27
 
479
- module_eval <<'..end parser.y modeval..id7b0b3dccb7', 'parser.y', 340
28
+ module_eval <<'..end lib/tmail/parser.y modeval..id2dd1c7d21d', 'lib/tmail/parser.y', 340
480
29
 
481
30
  include TextUtils
482
31
 
483
32
  def self.parse( ident, str, cmt = nil )
33
+ str = special_quote_address(str) if ident.to_s =~ /M?ADDRESS/
484
34
  new.parse(ident, str, cmt)
485
35
  end
486
36
 
37
+ def self.special_quote_address(str) #:nodoc:
38
+ # Takes a string which is an address and adds quotation marks to special
39
+ # edge case methods that the RACC parser can not handle.
40
+ #
41
+ # Right now just handles two edge cases:
42
+ #
43
+ # Full stop as the last character of the display name:
44
+ # Mikel L. <mikel@me.com>
45
+ # Returns:
46
+ # "Mikel L." <mikel@me.com>
47
+ #
48
+ # Unquoted @ symbol in the display name:
49
+ # mikel@me.com <mikel@me.com>
50
+ # Returns:
51
+ # "mikel@me.com" <mikel@me.com>
52
+ #
53
+ # Any other address not matching these patterns just gets returned as is.
54
+ case
55
+ # This handles the missing "" in an older version of Apple Mail.app
56
+ # around the display name when the display name contains a '@'
57
+ # like 'mikel@me.com <mikel@me.com>'
58
+ # Just quotes it to: '"mikel@me.com" <mikel@me.com>'
59
+ when str =~ /\A([^"].+@.+[^"])\s(<.*?>)\Z/
60
+ return "\"#{$1}\" #{$2}"
61
+ # This handles cases where 'Mikel A. <mikel@me.com>' which is a trailing
62
+ # full stop before the address section. Just quotes it to
63
+ # '"Mikel A." <mikel@me.com>'
64
+ when str =~ /\A(.*?\.)\s(<.*?>)\s*\Z/
65
+ return "\"#{$1}\" #{$2}"
66
+ else
67
+ str
68
+ end
69
+ end
70
+
487
71
  MAILP_DEBUG = false
488
72
 
489
73
  def initialize
@@ -516,10 +100,10 @@ module_eval <<'..end parser.y modeval..id7b0b3dccb7', 'parser.y', 340
516
100
  end
517
101
 
518
102
  def on_error( t, val, vstack )
519
- raise SyntaxError, "parse error on token #{racc_token2str t}"
103
+ raise TMail::SyntaxError, "parse error on token #{racc_token2str t}"
520
104
  end
521
105
 
522
- ..end parser.y modeval..id7b0b3dccb7
106
+ ..end lib/tmail/parser.y modeval..id2dd1c7d21d
523
107
 
524
108
  ##### racc 1.4.5 generates ###
525
109
 
@@ -639,109 +223,109 @@ racc_reduce_n = 109
639
223
  racc_shift_n = 167
640
224
 
641
225
  racc_action_table = [
642
- -70, -69, 23, 25, 145, 146, 29, 31, 105, 106,
643
- 16, 17, 20, 22, 136, 27, -70, -69, 32, 101,
644
- -70, -69, 153, 100, 113, 115, -70, -69, -70, 109,
645
- 75, 23, 25, 101, 154, 29, 31, 142, 143, 16,
646
- 17, 20, 22, 107, 27, 23, 25, 32, 98, 29,
647
- 31, 96, 94, 16, 17, 20, 22, 78, 27, 23,
648
- 25, 32, 112, 29, 31, 74, 91, 16, 17, 20,
649
- 22, 88, 117, 92, 81, 32, 23, 25, 80, 123,
650
- 29, 31, 100, 125, 16, 17, 20, 22, 126, 23,
651
- 25, 109, 32, 29, 31, 91, 128, 16, 17, 20,
652
- 22, 129, 27, 23, 25, 32, 101, 29, 31, 101,
653
- 130, 16, 17, 20, 22, 79, 52, 23, 25, 32,
654
- 78, 29, 31, 133, 78, 16, 17, 20, 22, 77,
655
- 23, 25, 75, 32, 29, 31, 65, 62, 16, 17,
656
- 20, 22, 139, 23, 25, 101, 32, 29, 31, 60,
657
- 100, 16, 17, 20, 22, 44, 27, 101, 147, 32,
658
- 23, 25, 120, 148, 29, 31, 151, 152, 16, 17,
659
- 20, 22, 42, 27, 156, 158, 32, 23, 25, 120,
660
- 40, 29, 31, 15, 163, 16, 17, 20, 22, 40,
661
- 27, 23, 25, 32, 68, 29, 31, 165, 166, 16,
662
- 17, 20, 22, nil, 27, 23, 25, 32, nil, 29,
663
- 31, 74, nil, 16, 17, 20, 22, nil, 23, 25,
226
+ -69, 130, -70, 23, 25, 153, 94, 29, 31, 142,
227
+ 143, 16, 17, 20, 22, 98, -69, 154, -70, 32,
228
+ -69, 107, -70, 145, 146, 78, -69, 91, -70, 75,
229
+ -70, 23, 25, 120, 88, 29, 31, 105, 106, 16,
230
+ 17, 20, 22, 81, 27, 23, 25, 32, 112, 29,
231
+ 31, 96, 80, 16, 17, 20, 22, 117, 27, 23,
232
+ 25, 32, 79, 29, 31, 78, 123, 16, 17, 20,
233
+ 22, 100, 27, 23, 25, 32, 125, 29, 31, 113,
234
+ 115, 16, 17, 20, 22, 126, 23, 25, 101, 32,
235
+ 29, 31, 91, 128, 16, 17, 20, 22, 129, 27,
236
+ 23, 25, 32, 101, 29, 31, 101, 75, 16, 17,
237
+ 20, 22, 77, 52, 23, 25, 32, 65, 29, 31,
238
+ 133, 78, 16, 17, 20, 22, 62, 23, 25, 136,
239
+ 32, 29, 31, 60, 44, 16, 17, 20, 22, 139,
240
+ 23, 25, 101, 32, 29, 31, 101, 100, 16, 17,
241
+ 20, 22, 100, 27, 23, 25, 32, 101, 29, 31,
242
+ 147, 148, 16, 17, 20, 22, 151, 23, 25, 152,
243
+ 32, 29, 31, 74, 42, 16, 17, 20, 22, 156,
244
+ 158, 92, 40, 32, 23, 25, 15, 68, 29, 31,
245
+ 163, 40, 16, 17, 20, 22, 165, 27, 23, 25,
246
+ 32, 166, 29, 31, nil, nil, 16, 17, 20, 22,
247
+ nil, 27, 23, 25, 32, nil, 29, 31, nil, nil,
248
+ 16, 17, 20, 22, nil, 23, 25, nil, 32, 29,
249
+ 31, nil, nil, 16, 17, 20, 22, nil, 23, 25,
664
250
  nil, 32, 29, 31, nil, nil, 16, 17, 20, 22,
665
251
  nil, 23, 25, nil, 32, 29, 31, nil, nil, 16,
666
- 17, 20, 22, nil, 23, 25, nil, 32, 29, 31,
667
- nil, nil, 16, 17, 20, 22, nil, 23, 25, nil,
668
- 32, 29, 31, nil, nil, 16, 17, 20, 22, nil,
669
- 27, 23, 25, 32, nil, 29, 31, nil, nil, 16,
670
- 17, 20, 22, nil, 23, 25, nil, 32, 29, 31,
671
- nil, nil, 16, 17, 20, 22, nil, 23, 25, nil,
672
- 32, 29, 31, nil, nil, 16, 17, 20, 22, nil,
673
- 84, 25, nil, 32, 29, 31, nil, 87, 16, 17,
674
- 20, 22, 4, 6, 7, 8, 9, 10, 11, 12,
675
- 13, 1, 2, 3, 84, 25, nil, nil, 29, 31,
252
+ 17, 20, 22, nil, 27, nil, nil, 32, 23, 25,
253
+ 120, nil, 29, 31, nil, nil, 16, 17, 20, 22,
254
+ nil, 27, 23, 25, 32, nil, 29, 31, nil, nil,
255
+ 16, 17, 20, 22, nil, 23, 25, 109, 32, 29,
256
+ 31, 74, nil, 16, 17, 20, 22, nil, 84, 25,
257
+ nil, 32, 29, 31, nil, 87, 16, 17, 20, 22,
258
+ 84, 25, nil, 109, 29, 31, nil, 87, 16, 17,
259
+ 20, 22, 84, 25, nil, nil, 29, 31, nil, 87,
260
+ 16, 17, 20, 22, 84, 25, nil, nil, 29, 31,
676
261
  nil, 87, 16, 17, 20, 22, 84, 25, nil, nil,
677
262
  29, 31, nil, 87, 16, 17, 20, 22, 84, 25,
678
263
  nil, nil, 29, 31, nil, 87, 16, 17, 20, 22,
679
- 84, 25, nil, nil, 29, 31, nil, 87, 16, 17,
680
- 20, 22, 84, 25, nil, nil, 29, 31, nil, 87,
681
- 16, 17, 20, 22, 84, 25, nil, nil, 29, 31,
682
- nil, 87, 16, 17, 20, 22 ]
264
+ 4, 6, 7, 8, 9, 10, 11, 12, 13, 1,
265
+ 2, 3, 84, 25, nil, nil, 29, 31, nil, 87,
266
+ 16, 17, 20, 22 ]
683
267
 
684
268
  racc_action_check = [
685
- 75, 28, 68, 68, 136, 136, 68, 68, 72, 72,
686
- 68, 68, 68, 68, 126, 68, 75, 28, 68, 67,
687
- 75, 28, 143, 66, 86, 86, 75, 28, 75, 75,
688
- 28, 3, 3, 86, 143, 3, 3, 134, 134, 3,
689
- 3, 3, 3, 73, 3, 151, 151, 3, 62, 151,
690
- 151, 60, 56, 151, 151, 151, 151, 51, 151, 52,
691
- 52, 151, 80, 52, 52, 52, 50, 52, 52, 52,
692
- 52, 45, 89, 52, 42, 52, 71, 71, 41, 96,
693
- 71, 71, 97, 98, 71, 71, 71, 71, 100, 7,
694
- 7, 101, 71, 7, 7, 102, 104, 7, 7, 7,
695
- 7, 105, 7, 8, 8, 7, 108, 8, 8, 111,
696
- 112, 8, 8, 8, 8, 40, 8, 9, 9, 8,
697
- 36, 9, 9, 117, 121, 9, 9, 9, 9, 33,
698
- 10, 10, 70, 9, 10, 10, 13, 12, 10, 10,
699
- 10, 10, 130, 2, 2, 131, 10, 2, 2, 11,
700
- 135, 2, 2, 2, 2, 6, 2, 138, 139, 2,
701
- 90, 90, 90, 140, 90, 90, 141, 142, 90, 90,
702
- 90, 90, 5, 90, 147, 150, 90, 127, 127, 127,
703
- 4, 127, 127, 1, 156, 127, 127, 127, 127, 158,
704
- 127, 26, 26, 127, 26, 26, 26, 162, 163, 26,
705
- 26, 26, 26, nil, 26, 27, 27, 26, nil, 27,
706
- 27, 27, nil, 27, 27, 27, 27, nil, 154, 154,
707
- nil, 27, 154, 154, nil, nil, 154, 154, 154, 154,
708
- nil, 122, 122, nil, 154, 122, 122, nil, nil, 122,
709
- 122, 122, 122, nil, 76, 76, nil, 122, 76, 76,
710
- nil, nil, 76, 76, 76, 76, nil, 38, 38, nil,
711
- 76, 38, 38, nil, nil, 38, 38, 38, 38, nil,
712
- 38, 55, 55, 38, nil, 55, 55, nil, nil, 55,
713
- 55, 55, 55, nil, 94, 94, nil, 55, 94, 94,
714
- nil, nil, 94, 94, 94, 94, nil, 59, 59, nil,
715
- 94, 59, 59, nil, nil, 59, 59, 59, 59, nil,
716
- 114, 114, nil, 59, 114, 114, nil, 114, 114, 114,
717
- 114, 114, 0, 0, 0, 0, 0, 0, 0, 0,
718
- 0, 0, 0, 0, 77, 77, nil, nil, 77, 77,
719
- nil, 77, 77, 77, 77, 77, 44, 44, nil, nil,
720
- 44, 44, nil, 44, 44, 44, 44, 44, 113, 113,
721
- nil, nil, 113, 113, nil, 113, 113, 113, 113, 113,
722
- 88, 88, nil, nil, 88, 88, nil, 88, 88, 88,
723
- 88, 88, 74, 74, nil, nil, 74, 74, nil, 74,
724
- 74, 74, 74, 74, 129, 129, nil, nil, 129, 129,
725
- nil, 129, 129, 129, 129, 129 ]
269
+ 28, 112, 75, 71, 71, 143, 56, 71, 71, 134,
270
+ 134, 71, 71, 71, 71, 62, 28, 143, 75, 71,
271
+ 28, 73, 75, 136, 136, 51, 28, 50, 75, 28,
272
+ 75, 127, 127, 127, 45, 127, 127, 72, 72, 127,
273
+ 127, 127, 127, 42, 127, 3, 3, 127, 80, 3,
274
+ 3, 60, 41, 3, 3, 3, 3, 89, 3, 151,
275
+ 151, 3, 40, 151, 151, 36, 96, 151, 151, 151,
276
+ 151, 97, 151, 55, 55, 151, 98, 55, 55, 86,
277
+ 86, 55, 55, 55, 55, 100, 7, 7, 86, 55,
278
+ 7, 7, 102, 104, 7, 7, 7, 7, 105, 7,
279
+ 8, 8, 7, 108, 8, 8, 111, 70, 8, 8,
280
+ 8, 8, 33, 8, 9, 9, 8, 13, 9, 9,
281
+ 117, 121, 9, 9, 9, 9, 12, 10, 10, 126,
282
+ 9, 10, 10, 11, 6, 10, 10, 10, 10, 130,
283
+ 2, 2, 131, 10, 2, 2, 67, 135, 2, 2,
284
+ 2, 2, 66, 2, 122, 122, 2, 138, 122, 122,
285
+ 139, 140, 122, 122, 122, 122, 141, 52, 52, 142,
286
+ 122, 52, 52, 52, 5, 52, 52, 52, 52, 147,
287
+ 150, 52, 4, 52, 26, 26, 1, 26, 26, 26,
288
+ 156, 158, 26, 26, 26, 26, 162, 26, 68, 68,
289
+ 26, 163, 68, 68, nil, nil, 68, 68, 68, 68,
290
+ nil, 68, 59, 59, 68, nil, 59, 59, nil, nil,
291
+ 59, 59, 59, 59, nil, 154, 154, nil, 59, 154,
292
+ 154, nil, nil, 154, 154, 154, 154, nil, 94, 94,
293
+ nil, 154, 94, 94, nil, nil, 94, 94, 94, 94,
294
+ nil, 38, 38, nil, 94, 38, 38, nil, nil, 38,
295
+ 38, 38, 38, nil, 38, nil, nil, 38, 90, 90,
296
+ 90, nil, 90, 90, nil, nil, 90, 90, 90, 90,
297
+ nil, 90, 76, 76, 90, nil, 76, 76, nil, nil,
298
+ 76, 76, 76, 76, nil, 27, 27, 76, 76, 27,
299
+ 27, 27, nil, 27, 27, 27, 27, nil, 114, 114,
300
+ nil, 27, 114, 114, nil, 114, 114, 114, 114, 114,
301
+ 44, 44, nil, 114, 44, 44, nil, 44, 44, 44,
302
+ 44, 44, 74, 74, nil, nil, 74, 74, nil, 74,
303
+ 74, 74, 74, 74, 113, 113, nil, nil, 113, 113,
304
+ nil, 113, 113, 113, 113, 113, 129, 129, nil, nil,
305
+ 129, 129, nil, 129, 129, 129, 129, 129, 88, 88,
306
+ nil, nil, 88, 88, nil, 88, 88, 88, 88, 88,
307
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
308
+ 0, 0, 77, 77, nil, nil, 77, 77, nil, 77,
309
+ 77, 77, 77, 77 ]
726
310
 
727
311
  racc_action_pointer = [
728
- 320, 152, 129, 17, 165, 172, 137, 75, 89, 103,
729
- 116, 135, 106, 105, nil, nil, nil, nil, nil, nil,
730
- nil, nil, nil, nil, nil, nil, 177, 191, 1, nil,
731
- nil, nil, nil, 109, nil, nil, 94, nil, 243, nil,
732
- 99, 64, 74, nil, 332, 52, nil, nil, nil, nil,
733
- 50, 31, 45, nil, nil, 257, 36, nil, nil, 283,
734
- 22, nil, 16, nil, nil, nil, -3, -10, -12, nil,
735
- 103, 62, -8, 15, 368, 0, 230, 320, nil, nil,
736
- 47, nil, nil, nil, nil, nil, 4, nil, 356, 50,
737
- 146, nil, nil, nil, 270, nil, 65, 56, 52, nil,
738
- 57, 62, 79, nil, 68, 81, nil, nil, 77, nil,
739
- nil, 80, 96, 344, 296, nil, nil, 108, nil, nil,
740
- nil, 98, 217, nil, nil, nil, -19, 163, nil, 380,
741
- 128, 116, nil, nil, 14, 124, -26, nil, 128, 141,
742
- 148, 141, 152, 7, nil, nil, nil, 160, nil, nil,
743
- 149, 31, nil, nil, 204, nil, 167, nil, 174, nil,
744
- nil, nil, 169, 184, nil, nil, nil ]
312
+ 378, 155, 126, 31, 167, 174, 116, 72, 86, 100,
313
+ 113, 119, 95, 86, nil, nil, nil, nil, nil, nil,
314
+ nil, nil, nil, nil, nil, nil, 170, 281, 0, nil,
315
+ nil, nil, nil, 92, nil, nil, 39, nil, 237, nil,
316
+ 46, 38, 43, nil, 306, 15, nil, nil, nil, nil,
317
+ 11, -1, 153, nil, nil, 59, -10, nil, nil, 198,
318
+ 22, nil, -17, nil, nil, nil, 126, 117, 184, nil,
319
+ 78, -11, 21, -7, 318, 2, 268, 378, nil, nil,
320
+ 33, nil, nil, nil, nil, nil, 59, nil, 354, 35,
321
+ 254, nil, nil, nil, 224, nil, 52, 45, 45, nil,
322
+ 54, nil, 76, nil, 65, 78, nil, nil, 74, nil,
323
+ nil, 77, -13, 330, 294, nil, nil, 105, nil, nil,
324
+ nil, 95, 140, nil, nil, nil, 96, 17, nil, 342,
325
+ 125, 113, nil, nil, -14, 121, -7, nil, 128, 143,
326
+ 146, 141, 154, -10, nil, nil, nil, 165, nil, nil,
327
+ 154, 45, nil, nil, 211, nil, 173, nil, 176, nil,
328
+ nil, nil, 168, 187, nil, nil, nil ]
745
329
 
746
330
  racc_action_default = [
747
331
  -109, -109, -109, -109, -14, -109, -20, -109, -109, -109,
@@ -958,79 +542,79 @@ Racc_debug_parser = false
958
542
 
959
543
  # reduce 0 omitted
960
544
 
961
- module_eval <<'.,.,', 'parser.y', 16
545
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 16
962
546
  def _reduce_1( val, _values)
963
547
  val[1]
964
548
  end
965
549
  .,.,
966
550
 
967
- module_eval <<'.,.,', 'parser.y', 17
551
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 17
968
552
  def _reduce_2( val, _values)
969
553
  val[1]
970
554
  end
971
555
  .,.,
972
556
 
973
- module_eval <<'.,.,', 'parser.y', 18
557
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 18
974
558
  def _reduce_3( val, _values)
975
559
  val[1]
976
560
  end
977
561
  .,.,
978
562
 
979
- module_eval <<'.,.,', 'parser.y', 19
563
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 19
980
564
  def _reduce_4( val, _values)
981
565
  val[1]
982
566
  end
983
567
  .,.,
984
568
 
985
- module_eval <<'.,.,', 'parser.y', 20
569
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 20
986
570
  def _reduce_5( val, _values)
987
571
  val[1]
988
572
  end
989
573
  .,.,
990
574
 
991
- module_eval <<'.,.,', 'parser.y', 21
575
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 21
992
576
  def _reduce_6( val, _values)
993
577
  val[1]
994
578
  end
995
579
  .,.,
996
580
 
997
- module_eval <<'.,.,', 'parser.y', 22
581
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 22
998
582
  def _reduce_7( val, _values)
999
583
  val[1]
1000
584
  end
1001
585
  .,.,
1002
586
 
1003
- module_eval <<'.,.,', 'parser.y', 23
587
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 23
1004
588
  def _reduce_8( val, _values)
1005
589
  val[1]
1006
590
  end
1007
591
  .,.,
1008
592
 
1009
- module_eval <<'.,.,', 'parser.y', 24
593
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 24
1010
594
  def _reduce_9( val, _values)
1011
595
  val[1]
1012
596
  end
1013
597
  .,.,
1014
598
 
1015
- module_eval <<'.,.,', 'parser.y', 25
599
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 25
1016
600
  def _reduce_10( val, _values)
1017
601
  val[1]
1018
602
  end
1019
603
  .,.,
1020
604
 
1021
- module_eval <<'.,.,', 'parser.y', 26
605
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 26
1022
606
  def _reduce_11( val, _values)
1023
607
  val[1]
1024
608
  end
1025
609
  .,.,
1026
610
 
1027
- module_eval <<'.,.,', 'parser.y', 27
611
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 27
1028
612
  def _reduce_12( val, _values)
1029
613
  val[1]
1030
614
  end
1031
615
  .,.,
1032
616
 
1033
- module_eval <<'.,.,', 'parser.y', 36
617
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 36
1034
618
  def _reduce_13( val, _values)
1035
619
  t = Time.gm(val[3].to_i, val[2], val[1].to_i, 0, 0, 0)
1036
620
  (t + val[4] - val[5]).localtime
@@ -1041,14 +625,14 @@ module_eval <<'.,.,', 'parser.y', 36
1041
625
 
1042
626
  # reduce 15 omitted
1043
627
 
1044
- module_eval <<'.,.,', 'parser.y', 45
628
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 45
1045
629
  def _reduce_16( val, _values)
1046
630
  (val[0].to_i * 60 * 60) +
1047
631
  (val[2].to_i * 60)
1048
632
  end
1049
633
  .,.,
1050
634
 
1051
- module_eval <<'.,.,', 'parser.y', 51
635
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 51
1052
636
  def _reduce_17( val, _values)
1053
637
  (val[0].to_i * 60 * 60) +
1054
638
  (val[2].to_i * 60) +
@@ -1056,13 +640,13 @@ module_eval <<'.,.,', 'parser.y', 51
1056
640
  end
1057
641
  .,.,
1058
642
 
1059
- module_eval <<'.,.,', 'parser.y', 56
643
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 56
1060
644
  def _reduce_18( val, _values)
1061
645
  timezone_string_to_unixtime(val[0])
1062
646
  end
1063
647
  .,.,
1064
648
 
1065
- module_eval <<'.,.,', 'parser.y', 61
649
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 61
1066
650
  def _reduce_19( val, _values)
1067
651
  val
1068
652
  end
@@ -1070,7 +654,7 @@ module_eval <<'.,.,', 'parser.y', 61
1070
654
 
1071
655
  # reduce 20 omitted
1072
656
 
1073
- module_eval <<'.,.,', 'parser.y', 67
657
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 67
1074
658
  def _reduce_21( val, _values)
1075
659
  val[1]
1076
660
  end
@@ -1078,25 +662,25 @@ module_eval <<'.,.,', 'parser.y', 67
1078
662
 
1079
663
  # reduce 22 omitted
1080
664
 
1081
- module_eval <<'.,.,', 'parser.y', 73
665
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 73
1082
666
  def _reduce_23( val, _values)
1083
667
  val[1]
1084
668
  end
1085
669
  .,.,
1086
670
 
1087
- module_eval <<'.,.,', 'parser.y', 79
671
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 79
1088
672
  def _reduce_24( val, _values)
1089
673
  join_domain(val[0])
1090
674
  end
1091
675
  .,.,
1092
676
 
1093
- module_eval <<'.,.,', 'parser.y', 83
677
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 83
1094
678
  def _reduce_25( val, _values)
1095
679
  join_domain(val[2])
1096
680
  end
1097
681
  .,.,
1098
682
 
1099
- module_eval <<'.,.,', 'parser.y', 87
683
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 87
1100
684
  def _reduce_26( val, _values)
1101
685
  join_domain(val[0])
1102
686
  end
@@ -1104,19 +688,19 @@ module_eval <<'.,.,', 'parser.y', 87
1104
688
 
1105
689
  # reduce 27 omitted
1106
690
 
1107
- module_eval <<'.,.,', 'parser.y', 93
691
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 93
1108
692
  def _reduce_28( val, _values)
1109
693
  val[1]
1110
694
  end
1111
695
  .,.,
1112
696
 
1113
- module_eval <<'.,.,', 'parser.y', 98
697
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 98
1114
698
  def _reduce_29( val, _values)
1115
699
  []
1116
700
  end
1117
701
  .,.,
1118
702
 
1119
- module_eval <<'.,.,', 'parser.y', 103
703
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 103
1120
704
  def _reduce_30( val, _values)
1121
705
  val[0].push val[2]
1122
706
  val[0]
@@ -1125,13 +709,13 @@ module_eval <<'.,.,', 'parser.y', 103
1125
709
 
1126
710
  # reduce 31 omitted
1127
711
 
1128
- module_eval <<'.,.,', 'parser.y', 109
712
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 109
1129
713
  def _reduce_32( val, _values)
1130
714
  val[1]
1131
715
  end
1132
716
  .,.,
1133
717
 
1134
- module_eval <<'.,.,', 'parser.y', 113
718
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 113
1135
719
  def _reduce_33( val, _values)
1136
720
  val[1]
1137
721
  end
@@ -1139,19 +723,19 @@ module_eval <<'.,.,', 'parser.y', 113
1139
723
 
1140
724
  # reduce 34 omitted
1141
725
 
1142
- module_eval <<'.,.,', 'parser.y', 119
726
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 119
1143
727
  def _reduce_35( val, _values)
1144
728
  val[1]
1145
729
  end
1146
730
  .,.,
1147
731
 
1148
- module_eval <<'.,.,', 'parser.y', 125
732
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 125
1149
733
  def _reduce_36( val, _values)
1150
734
  val[0].spec
1151
735
  end
1152
736
  .,.,
1153
737
 
1154
- module_eval <<'.,.,', 'parser.y', 129
738
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 129
1155
739
  def _reduce_37( val, _values)
1156
740
  val[0].spec
1157
741
  end
@@ -1159,7 +743,7 @@ module_eval <<'.,.,', 'parser.y', 129
1159
743
 
1160
744
  # reduce 38 omitted
1161
745
 
1162
- module_eval <<'.,.,', 'parser.y', 136
746
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 136
1163
747
  def _reduce_39( val, _values)
1164
748
  val[1]
1165
749
  end
@@ -1179,19 +763,19 @@ module_eval <<'.,.,', 'parser.y', 136
1179
763
 
1180
764
  # reduce 46 omitted
1181
765
 
1182
- module_eval <<'.,.,', 'parser.y', 146
766
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 146
1183
767
  def _reduce_47( val, _values)
1184
768
  [ Address.new(nil, nil) ]
1185
769
  end
1186
770
  .,.,
1187
771
 
1188
- module_eval <<'.,.,', 'parser.y', 152
772
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 152
1189
773
  def _reduce_48( val, _values)
1190
774
  val
1191
775
  end
1192
776
  .,.,
1193
777
 
1194
- module_eval <<'.,.,', 'parser.y', 157
778
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 157
1195
779
  def _reduce_49( val, _values)
1196
780
  val[0].push val[2]
1197
781
  val[0]
@@ -1202,13 +786,13 @@ module_eval <<'.,.,', 'parser.y', 157
1202
786
 
1203
787
  # reduce 51 omitted
1204
788
 
1205
- module_eval <<'.,.,', 'parser.y', 165
789
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 165
1206
790
  def _reduce_52( val, _values)
1207
791
  val
1208
792
  end
1209
793
  .,.,
1210
794
 
1211
- module_eval <<'.,.,', 'parser.y', 170
795
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 170
1212
796
  def _reduce_53( val, _values)
1213
797
  val[0].push val[2]
1214
798
  val[0]
@@ -1219,7 +803,7 @@ module_eval <<'.,.,', 'parser.y', 170
1219
803
 
1220
804
  # reduce 55 omitted
1221
805
 
1222
- module_eval <<'.,.,', 'parser.y', 178
806
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 178
1223
807
  def _reduce_56( val, _values)
1224
808
  val[1].phrase = Decoder.decode(val[0])
1225
809
  val[1]
@@ -1228,38 +812,38 @@ module_eval <<'.,.,', 'parser.y', 178
1228
812
 
1229
813
  # reduce 57 omitted
1230
814
 
1231
- module_eval <<'.,.,', 'parser.y', 185
815
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 185
1232
816
  def _reduce_58( val, _values)
1233
817
  AddressGroup.new(val[0], val[2])
1234
818
  end
1235
819
  .,.,
1236
820
 
1237
- module_eval <<'.,.,', 'parser.y', 185
821
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 185
1238
822
  def _reduce_59( val, _values)
1239
823
  AddressGroup.new(val[0], [])
1240
824
  end
1241
825
  .,.,
1242
826
 
1243
- module_eval <<'.,.,', 'parser.y', 188
827
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 188
1244
828
  def _reduce_60( val, _values)
1245
829
  val[0].join('.')
1246
830
  end
1247
831
  .,.,
1248
832
 
1249
- module_eval <<'.,.,', 'parser.y', 189
833
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 189
1250
834
  def _reduce_61( val, _values)
1251
835
  val[0] << ' ' << val[1].join('.')
1252
836
  end
1253
837
  .,.,
1254
838
 
1255
- module_eval <<'.,.,', 'parser.y', 196
839
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 196
1256
840
  def _reduce_62( val, _values)
1257
841
  val[2].routes.replace val[1]
1258
842
  val[2]
1259
843
  end
1260
844
  .,.,
1261
845
 
1262
- module_eval <<'.,.,', 'parser.y', 200
846
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 200
1263
847
  def _reduce_63( val, _values)
1264
848
  val[1]
1265
849
  end
@@ -1267,25 +851,25 @@ module_eval <<'.,.,', 'parser.y', 200
1267
851
 
1268
852
  # reduce 64 omitted
1269
853
 
1270
- module_eval <<'.,.,', 'parser.y', 203
854
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 203
1271
855
  def _reduce_65( val, _values)
1272
856
  [ val[1].join('.') ]
1273
857
  end
1274
858
  .,.,
1275
859
 
1276
- module_eval <<'.,.,', 'parser.y', 204
860
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 204
1277
861
  def _reduce_66( val, _values)
1278
862
  val[0].push val[3].join('.'); val[0]
1279
863
  end
1280
864
  .,.,
1281
865
 
1282
- module_eval <<'.,.,', 'parser.y', 206
866
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 206
1283
867
  def _reduce_67( val, _values)
1284
868
  Address.new( val[0], val[2] )
1285
869
  end
1286
870
  .,.,
1287
871
 
1288
- module_eval <<'.,.,', 'parser.y', 207
872
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 207
1289
873
  def _reduce_68( val, _values)
1290
874
  Address.new( val[0], nil )
1291
875
  end
@@ -1293,19 +877,19 @@ module_eval <<'.,.,', 'parser.y', 207
1293
877
 
1294
878
  # reduce 69 omitted
1295
879
 
1296
- module_eval <<'.,.,', 'parser.y', 210
880
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 210
1297
881
  def _reduce_70( val, _values)
1298
882
  val[0].push ''; val[0]
1299
883
  end
1300
884
  .,.,
1301
885
 
1302
- module_eval <<'.,.,', 'parser.y', 213
886
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 213
1303
887
  def _reduce_71( val, _values)
1304
888
  val
1305
889
  end
1306
890
  .,.,
1307
891
 
1308
- module_eval <<'.,.,', 'parser.y', 222
892
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 222
1309
893
  def _reduce_72( val, _values)
1310
894
  val[1].times do
1311
895
  val[0].push ''
@@ -1315,13 +899,13 @@ module_eval <<'.,.,', 'parser.y', 222
1315
899
  end
1316
900
  .,.,
1317
901
 
1318
- module_eval <<'.,.,', 'parser.y', 224
902
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 224
1319
903
  def _reduce_73( val, _values)
1320
904
  val
1321
905
  end
1322
906
  .,.,
1323
907
 
1324
- module_eval <<'.,.,', 'parser.y', 233
908
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 233
1325
909
  def _reduce_74( val, _values)
1326
910
  val[1].times do
1327
911
  val[0].push ''
@@ -1331,15 +915,15 @@ module_eval <<'.,.,', 'parser.y', 233
1331
915
  end
1332
916
  .,.,
1333
917
 
1334
- module_eval <<'.,.,', 'parser.y', 234
918
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 234
1335
919
  def _reduce_75( val, _values)
1336
920
  0
1337
921
  end
1338
922
  .,.,
1339
923
 
1340
- module_eval <<'.,.,', 'parser.y', 235
924
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 235
1341
925
  def _reduce_76( val, _values)
1342
- 1
926
+ val[0] + 1
1343
927
  end
1344
928
  .,.,
1345
929
 
@@ -1359,20 +943,20 @@ module_eval <<'.,.,', 'parser.y', 235
1359
943
 
1360
944
  # reduce 84 omitted
1361
945
 
1362
- module_eval <<'.,.,', 'parser.y', 253
946
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 253
1363
947
  def _reduce_85( val, _values)
1364
948
  val[1] = val[1].spec
1365
949
  val.join('')
1366
950
  end
1367
951
  .,.,
1368
952
 
1369
- module_eval <<'.,.,', 'parser.y', 254
953
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 254
1370
954
  def _reduce_86( val, _values)
1371
955
  val
1372
956
  end
1373
957
  .,.,
1374
958
 
1375
- module_eval <<'.,.,', 'parser.y', 255
959
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 255
1376
960
  def _reduce_87( val, _values)
1377
961
  val[0].push val[2]; val[0]
1378
962
  end
@@ -1380,70 +964,70 @@ module_eval <<'.,.,', 'parser.y', 255
1380
964
 
1381
965
  # reduce 88 omitted
1382
966
 
1383
- module_eval <<'.,.,', 'parser.y', 258
967
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 258
1384
968
  def _reduce_89( val, _values)
1385
969
  val[0] << ' ' << val[1]
1386
970
  end
1387
971
  .,.,
1388
972
 
1389
- module_eval <<'.,.,', 'parser.y', 265
973
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 265
1390
974
  def _reduce_90( val, _values)
1391
975
  val.push nil
1392
976
  val
1393
977
  end
1394
978
  .,.,
1395
979
 
1396
- module_eval <<'.,.,', 'parser.y', 269
980
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 269
1397
981
  def _reduce_91( val, _values)
1398
982
  val
1399
983
  end
1400
984
  .,.,
1401
985
 
1402
- module_eval <<'.,.,', 'parser.y', 274
986
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 274
1403
987
  def _reduce_92( val, _values)
1404
988
  [ val[0].to_i, val[2].to_i ]
1405
989
  end
1406
990
  .,.,
1407
991
 
1408
- module_eval <<'.,.,', 'parser.y', 279
992
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 279
1409
993
  def _reduce_93( val, _values)
1410
994
  [ val[0].downcase, val[2].downcase, decode_params(val[3]) ]
1411
995
  end
1412
996
  .,.,
1413
997
 
1414
- module_eval <<'.,.,', 'parser.y', 283
998
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 283
1415
999
  def _reduce_94( val, _values)
1416
1000
  [ val[0].downcase, nil, decode_params(val[1]) ]
1417
1001
  end
1418
1002
  .,.,
1419
1003
 
1420
- module_eval <<'.,.,', 'parser.y', 288
1004
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 288
1421
1005
  def _reduce_95( val, _values)
1422
1006
  {}
1423
1007
  end
1424
1008
  .,.,
1425
1009
 
1426
- module_eval <<'.,.,', 'parser.y', 293
1010
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 293
1427
1011
  def _reduce_96( val, _values)
1428
1012
  val[0][ val[2].downcase ] = ('"' + val[4].to_s + '"')
1429
1013
  val[0]
1430
1014
  end
1431
1015
  .,.,
1432
1016
 
1433
- module_eval <<'.,.,', 'parser.y', 298
1017
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 298
1434
1018
  def _reduce_97( val, _values)
1435
1019
  val[0][ val[2].downcase ] = val[4]
1436
1020
  val[0]
1437
1021
  end
1438
1022
  .,.,
1439
1023
 
1440
- module_eval <<'.,.,', 'parser.y', 303
1024
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 303
1441
1025
  def _reduce_98( val, _values)
1442
1026
  val[0].downcase
1443
1027
  end
1444
1028
  .,.,
1445
1029
 
1446
- module_eval <<'.,.,', 'parser.y', 308
1030
+ module_eval <<'.,.,', 'lib/tmail/parser.y', 308
1447
1031
  def _reduce_99( val, _values)
1448
1032
  [ val[0].downcase, decode_params(val[1]) ]
1449
1033
  end