jpmobile 1.0.10 → 1.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
- ---
2
- :build:
3
- :patch: 10
1
+ ---
4
2
  :major: 1
5
3
  :minor: 0
4
+ :patch: 11
5
+ :build:
data/jpmobile.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jpmobile}
8
- s.version = "1.0.10"
8
+ s.version = "1.0.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Yoji Shidara", "Shin-ichiro OGAWA"]
data/lib/jpmobile/mail.rb CHANGED
@@ -18,7 +18,7 @@ module Mail
18
18
 
19
19
  # change encoding
20
20
  def self.b_value_encode(str, encoding)
21
- str = Jpmobile::Util.encode(str, encoding)
21
+ str = Jpmobile::Util.encode(str, encoding.to_s)
22
22
  [Ruby19.encode_base64(str), encoding]
23
23
  end
24
24
  end
@@ -48,9 +48,10 @@ module Mail
48
48
  if @mobile = m
49
49
  @charset = m.mail_charset(@charset)
50
50
 
51
- if @body
52
- @body.charset = @charset
53
- @body.mobile = m
51
+ if self.body
52
+ self.body.content_type_with_jpmobile = self.content_type
53
+ self.body.charset = @charset
54
+ self.body.mobile = m
54
55
  end
55
56
  end
56
57
  end
@@ -60,7 +61,7 @@ module Mail
60
61
  header['subject'].mobile = @mobile if header['subject']
61
62
  header['from'].mobile = @mobile if header['from']
62
63
  header['to'].mobile = @mobile if header['to']
63
- self.charset = @mobile.mail_charset(@charset)
64
+ self.charset = @mobile.mail_charset
64
65
 
65
66
  ready_to_send!
66
67
 
@@ -115,17 +116,18 @@ module Mail
115
116
  if @mobile
116
117
  @body.charset = @charset
117
118
  @body.mobile = @mobile
119
+ @body.content_type_with_jpmobile = self.content_type
118
120
 
119
121
  if has_content_transfer_encoding? and
120
- ["base64", "quoted-printable"].include?(content_transfer_encoding) and
122
+ ["base64", "quoted-printable"].include?(self.content_transfer_encoding) and
121
123
  ["text"].include?(@mobile_main_type)
122
124
  @body.decode_transfer_encoding
123
125
  end
124
126
 
125
127
  if @body.multipart?
126
128
  @body.parts.each do |p|
127
- p.charset = @charset
128
- p.mobile = @mobile
129
+ p.charset = @mobile.mail_charset(p.charset)
130
+ p.mobile = @mobile
129
131
  end
130
132
  end
131
133
  end
@@ -277,7 +279,16 @@ module Mail
277
279
  end
278
280
  end
279
281
 
280
- if @body_part_jpmobile and @mobile
282
+ if @body_part_jpmobile and @mobile and !@charset.blank?
283
+ if ["base64", "quoted-printable"].include?(self.content_transfer_encoding) and
284
+ self.content_type.match(/text/)
285
+ @body_part_jpmobile = Jpmobile::Util.decode(@body_part_jpmobile, self.content_transfer_encoding, @charset)
286
+ self.content_transfer_encoding = @mobile.class::MAIL_CONTENT_TRANSFER_ENCODING
287
+ end
288
+ unless Jpmobile::Util.check_charset(@body_part_jpmobile, @charset)
289
+ @body_part_jpmobile = Jpmobile::Util.correct_encoding(@body_part_jpmobile)
290
+ @charset = @body_part_jpmobile.encoding.to_s
291
+ end
281
292
  @body_part_jpmobile = @mobile.decode_transfer_encoding(@body_part_jpmobile, @charset)
282
293
  end
283
294
  end
@@ -311,7 +322,7 @@ module Mail
311
322
  end
312
323
 
313
324
  class Body
314
- attr_accessor :mobile
325
+ attr_accessor :mobile, :content_type_with_jpmobile
315
326
 
316
327
  # convert encoding
317
328
  def encoded_with_jpmobile(transfer_encoding = '8bit')
@@ -319,10 +330,16 @@ module Mail
319
330
  if @mobile.to_mail_body_encoded?(@raw_source)
320
331
  @raw_source
321
332
  elsif Jpmobile::Util.ascii_8bit?(@raw_source)
322
- enc = Mail::Encodings::get_encoding(get_best_encoding(transfer_encoding))
323
- Jpmobile::Util.force_encode(enc.encode(@raw_source), nil, @charset)
333
+ _raw_source = if transfer_encoding == encoding
334
+ @raw_source
335
+ else
336
+ enc = Mail::Encodings::get_encoding(get_best_encoding(transfer_encoding))
337
+ enc.encode(@raw_source)
338
+ end
339
+ Jpmobile::Util.force_encode(_raw_source, nil, @charset)
324
340
  else
325
- if transfer_encoding == 'quoted-printable'
341
+ case transfer_encoding
342
+ when /quoted-printable/
326
343
  # [str].pack("M").gsub(/\n/, "\r\n")
327
344
  Jpmobile::Util.force_encode([@mobile.to_mail_body(Jpmobile::Util.force_encode(@raw_source, @charset, Jpmobile::Util::UTF8))].pack("M").gsub(/\n/, "\r\n"), Jpmobile::Util::BINARY, @charset)
328
345
  # @mobile.to_mail_body(Jpmobile::Util.force_encode(@raw_source, @charset, Jpmobile::Util::UTF8))
@@ -347,23 +364,25 @@ module Mail
347
364
  def mobile=(m)
348
365
  @mobile = m
349
366
 
367
+ if ["base64", "quoted-printable"].include?(self.encoding) and
368
+ /text/.match(self.content_type_with_jpmobile)
369
+ self.decode_transfer_encoding
370
+ end
371
+
350
372
  if self.multipart? and @mobile
351
373
  self.parts.each do |part|
352
- part.charset = @charset
374
+ part.charset = @mobile.mail_charset(part.charset)
353
375
  part.mobile = @mobile
354
- part.body.charset = @charset
376
+ part.body.charset = part.charset
355
377
  part.body.mobile = @mobile
356
378
  end
357
379
  end
358
380
  end
359
381
 
360
382
  def decode_transfer_encoding
361
- _raw_source = Encodings.get_encoding(encoding).decode(@raw_source)
362
- unless Jpmobile::Util.extract_charset(_raw_source) == @charset
363
- @charset = Jpmobile::Util.extract_charset(_raw_source)
364
- end
365
- _raw_source = Jpmobile::Util.set_encoding(_raw_source, @charset)
383
+ _raw_source = Jpmobile::Util.decode(@raw_source, self.encoding, @charset)
366
384
  @raw_source = @mobile.decode_transfer_encoding(_raw_source, @charset)
385
+ self.encoding = 'text'
367
386
  end
368
387
 
369
388
  def preamble_with_jpmobile
@@ -458,15 +477,15 @@ module Mail
458
477
 
459
478
  def mobile=(m)
460
479
  if @mobile = m
461
- self.charset = @mobile.mail_charset(@charset)
462
- self.value = @jpmobile_raw_text
480
+ self.charset = @mobile.mail_charset
481
+ self.value = @jpmobile_raw_text
463
482
  self.parse
464
483
  end
465
484
  end
466
485
 
467
486
  def encoded_with_jpmobile
468
487
  if @mobile
469
- self.charset = @mobile.mail_charset(@charset)
488
+ self.charset = @mobile.mail_charset
470
489
  end
471
490
 
472
491
  encoded_without_jpmobile
@@ -487,15 +506,15 @@ module Mail
487
506
 
488
507
  def mobile=(m)
489
508
  if @mobile = m
490
- self.charset = @mobile.mail_charset(@charset)
491
- self.value = @jpmobile_raw_text
509
+ self.charset = @mobile.mail_charset
510
+ self.value = @jpmobile_raw_text
492
511
  self.parse
493
512
  end
494
513
  end
495
514
 
496
515
  def encoded_with_jpmobile
497
516
  if @mobile
498
- self.charset = @mobile.mail_charset(@charset)
517
+ self.charset = @mobile.mail_charset
499
518
  end
500
519
 
501
520
  encoded_without_jpmobile
@@ -105,7 +105,7 @@ module Jpmobile::Mobile
105
105
  # メール送信用
106
106
  def to_mail_subject(str)
107
107
  Jpmobile::Util.fold_text(Jpmobile::Emoticon.unicodecr_to_utf8(str)).
108
- map{|text| "=?#{mail_charset}?B?" + [to_mail_encoding(text)].pack('m').strip + "?=" }.
108
+ map{|text| "=?#{mail_charset}?B?" + [to_mail_encoding(text)].pack('m').gsub(/\n/, '') + "?=" }.
109
109
  join("\n\s")
110
110
  end
111
111
  def to_mail_body(str)
@@ -113,7 +113,8 @@ module Jpmobile::Mobile
113
113
  end
114
114
  def mail_charset(charset = nil)
115
115
  # (charset.nil? or charset == "") ? self.class::MAIL_CHARSET : charset
116
- self.class::MAIL_CHARSET
116
+ # self.class::MAIL_CHARSET
117
+ charset.nil? || charset == '' || charset =~ /US-ASCII/i ? self.class::MAIL_CHARSET : charset
117
118
  end
118
119
  def content_transfer_encoding(headers)
119
120
  transfer_encoding = headers['Content-Transfer-Encoding']
data/lib/jpmobile/util.rb CHANGED
@@ -393,5 +393,49 @@ module Jpmobile
393
393
  end
394
394
  result
395
395
  end
396
+
397
+ def decode(str, encoding, charset)
398
+ _str = case encoding
399
+ when /quoted-printable/i
400
+ str.unpack('M').first.strip
401
+ when /base64/i
402
+ str.unpack('m').first.strip
403
+ else
404
+ str
405
+ end
406
+
407
+ _extract_charset = Jpmobile::Util.extract_charset(_str)
408
+ charset = _extract_charset unless _extract_charset.blank? or _extract_charset == charset
409
+ Jpmobile::Util.set_encoding(_str, charset)
410
+ end
411
+
412
+ def check_charset(str, charset)
413
+ if Object.const_defined?(:Encoding)
414
+ # use NKF.guess
415
+ ::Encoding.compatible?(NKF.guess(str), ::Encoding.find(charset))
416
+ else
417
+ true
418
+ end
419
+ end
420
+
421
+ def correct_encoding(str)
422
+ if Object.const_defined?(:Encoding)
423
+ if str.encoding != ::Encoding::ASCII_8BIT and NKF.guess(str) != str.encoding
424
+ str.force_encoding(NKF.guess(str))
425
+ end
426
+ else
427
+ str = case NKF.guess(str)
428
+ when NKF::UTF8
429
+ NKF.nkf('-w', str)
430
+ when NKF::JIS
431
+ pp '1'
432
+ NKF.nkf('-j', str)
433
+ when NKF::SJIS
434
+ NKF.nkf("-s", str)
435
+ end
436
+ end
437
+
438
+ str
439
+ end
396
440
  end
397
441
  end
@@ -0,0 +1,42 @@
1
+ Return-Path: <au@ezweb.ne.jp>
2
+ Delivered-To: ogawa@jpmobile-info.co.jp
3
+ Subject: =?iso-2022-jp?B?RndkOiAbJEIhWhsoQk51cnNlcnlNYWlsGyRCIVtGfEZ8GyhC?=
4
+ From: au@ezweb.ne.jp
5
+ Content-Type: multipart/alternative;
6
+ boundary=Apple-Mail-453BF7C8-E087-4CEB-A163-18A4B0CBB56C
7
+ Message-Id: <5C2DBDE0-7AE2-4BD2-B932-97B59EAFED85@ezweb.ne.jp>
8
+ Date: Tue, 31 Jul 2012 10:44:23 +0900 (JST)
9
+ To: test@jpmobile-info.org
10
+ Content-Transfer-Encoding: 7bit
11
+ MIME-Version: 1.0
12
+
13
+ --Apple-Mail-453BF7C8-E087-4CEB-A163-18A4B0CBB56C
14
+ Content-Transfer-Encoding: quoted-printable
15
+ Content-Type: text/plain;
16
+ charset=iso-2022-jp
17
+
18
+
19
+
20
+ iPhone=1B$B$+$iAw?.=1B(B
21
+
22
+ Begin forwarded message:
23
+
24
+ > =1B$B$H$j$"$($:#H#T#M#L$NK\J8$G=1B(B
25
+ > =1B$B$"$l$P$$$$2DG=3D@-$r9MN8$7$F$O=1B(B
26
+ > =1B$B8+$?$,$d$O$j$Y!<$9$m$/$h$s!J>P!K$G=1B(B
27
+ > =1B$B$"$l$P$$$$$h$&$J5$$,=1B(B
28
+ > =1B$B$7$?$N$G%@%_!<$NJ8;zNs$r=1B(B
29
+ > =1B$B9M$($F8+$kD+!#=1B(B=
30
+
31
+ --Apple-Mail-453BF7C8-E087-4CEB-A163-18A4B0CBB56C
32
+ Content-Transfer-Encoding: base64
33
+ Content-Type: text/html;
34
+ charset=utf-8
35
+
36
+ 44Go44KK44GC44GI44Ga77yo77y077yt77ys44Gu5pys5paH44Gn44GC44KM
37
+ 44Gw44GE44GE5Y+v6IO95oCn44KS6ICD5oWu44GX44Gm44Gv6KaL44Gf44GM
38
+ 44KE44Gv44KK44G544O844GZ44KN44GP44KI44KT77yI56yR77yJ44Gn44GC
39
+ 44KM44Gw44GE44GE44KI44GG44Gq5rCX44GM44GX44Gf44Gu44Gn44OA44Of
40
+ 44O844Gu5paH5a2X5YiX44KS6ICD44GI44Gm6KaL44KL5pyd44CC
41
+ --Apple-Mail-453BF7C8-E087-4CEB-A163-18A4B0CBB56C--
42
+
@@ -0,0 +1,56 @@
1
+ X-Mozilla-Status: 0011
2
+ X-Mozilla-Status2: 00000000
3
+ X-Mozilla-Keys:
4
+ Return-Path: <au@ezweb.ne.jp>
5
+ Delivered-To: au@ezweb.ne.jp
6
+ References: <503ef27994050_75cf4344bfe77fe@jpmobile.jp.mail>
7
+ In-Reply-To: <503ef27994050_75cf4344bfe77fe@jpmobile.jp.mail>
8
+ Mime-Version: 1.0 (1.0)
9
+ Content-Transfer-Encoding: base64
10
+ Content-Type: text/plain;
11
+ charset=utf-8
12
+ Message-Id: <6D015993-FD10-4EE9-8B60-A4588D554649@ezweb.ne.jp>
13
+ X-Mailer: iPhone Mail (9B206)
14
+ From: "au@ezweb.ne.jp" <au@ezweb.ne.jp>
15
+ Subject: =?iso-2022-jp?B?UmU6IBskQiFaGyhCTktTQxskQiFbGyhCdGVzdA==?=
16
+ Date: Thu, 30 Aug 2012 14:49:20 +0900
17
+ To: "info@jpmobile.jp" <info@jpmobile.jp>
18
+
19
+ DQoNCmlQaG9uZeOBi+OCiemAgeS/oeKXi+KXjg0KDQpPbiAyMDEyLzA4LzMw
20
+ LCBhdCAxMzo1NiwgaW5mb0BqcG1vYmlsZS5qcCB3cm90ZToNCg0KPiDmnKzm
21
+ lofmlLnooYzjgarjgZfvvL/vvJXvvJHvvJLmloflrZfvvL/jgYLjgYLjgYLj
22
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
23
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
24
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
25
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
26
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
27
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
28
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
29
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
30
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
31
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
32
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
33
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
34
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
35
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
36
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
37
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
38
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
39
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
40
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
41
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
42
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
43
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
44
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
45
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
46
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
47
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
48
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
49
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
50
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
51
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
52
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLj
53
+ gYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLjgYLvv73vv73ilrPi
54
+ lrPilrPilrPilrPilrPilrPilrPilrPilrPilrPilrPilrPilrPilrPilrPi
55
+ lrPilrPvv70NCg==
56
+
@@ -0,0 +1,27 @@
1
+ X-Account-Key: account2
2
+ X-UIDL: 1345598846.M744553P8903V000000000000FD00I00000000C0120BDF_0.jpjp.jp,S=1186.000031434a023554
3
+ X-Mozilla-Status: 0001
4
+ X-Mozilla-Status2: 00000000
5
+ X-Mozilla-Keys:
6
+ Return-Path: <au@ezweb.ne.jp>
7
+ Delivered-To: ogawa@jpmobile.jp
8
+ Received: (qmail 8893 invoked by SAV 20120821.022 by uid 0); 22 Aug 2012 10:27:26 +0900
9
+ Received: from unknown (HELO mmsmta08.ezweb.ne.jp) (59.135.39.241)
10
+ by dc6.etius.jp (124.146.201.109) with ESMTPS (DHE-RSA-AES256-SHA encrypted); 22 Aug 2012 10:27:26 +0900
11
+ Received-SPF: pass (dc6.etius.jp: SPF record at spf-nm.ezweb.ne.jp designates 59.135.39.241 as permitted sender)
12
+ Received: from cm (pl0_4-mms [172.22.116.39])
13
+ by mmsmta08.ezweb.ne.jp (Sentrion-MTA-4.1.0/Switch-3.3.4) with SMTP id q7M1RQgt001822
14
+ for <info@jpmobile.jp>; Wed, 22 Aug 2012 10:27:26 +0900
15
+ From:au@ezweb.ne.jp
16
+ To:ogawa@jpmobile.jp
17
+ Subject:=?UTF-8?B?aVBob25lIGF1IOODoeODg+OCu+ODvOOCuA==?=
18
+ Message-ID: <212212358846052174@-212212358846052175>
19
+ Date: Tue, 22 Aug 2012 01:27:26 +0000
20
+ MIME-Version:1.0
21
+ Content-Type: text/plain; charset=utf-8
22
+ Content-Transfer-Encoding: base64
23
+
24
+ JVvlnJLlhZDlkI1dJeOBriVb5L+d6K236ICF5ZCNXSUg5qeYCgrmlr3oqK3jgavpgIHkv6HjgIIK
25
+ 6YG45oqeMeOBryVb44Ki44OJ44Os44K5MV0l44G4CumBuOaKnjLjga8lW+OCouODieODrOOCuTJd
26
+ JeOBuArov5Tkv6HjgZfjgabkuIvjgZXjgYTjgIIKCmlQaG9uZSBhdSDjg6Hjg4Pjgrvjg7zjgrg=
27
+
@@ -255,6 +255,31 @@ describe "Jpmobile::Mail" do
255
255
  end
256
256
  end
257
257
 
258
+ describe "long subject with half-characters" do
259
+ before(:each) do
260
+ @mail = Mail.new
261
+ @mail.subject = "西暦2012年09月03日は今日になるわけだが10時16分現在のこの時間ではどうかな"
262
+ @mail.body = "株式会社・・"
263
+ @mail.from = "info@jpmobile-rails.org"
264
+ end
265
+
266
+ describe "AbstractMobile" do
267
+ before(:each) do
268
+ @mobile = Jpmobile::Mobile::AbstractMobile.new(nil, nil)
269
+ @mail.mobile = @mobile
270
+ @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
271
+ end
272
+
273
+ context "to_s" do
274
+ it "should contain encoded subject" do
275
+ ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCQD5OcRsoQjIwMTIbJEJHLxsoQjA5GyRCN24bKEIwMxskQkZ8JE86IxsoQg==?=")))
276
+ ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCRnwkSyRKJGskbyQxJEAkLBsoQjEwGyRCO34bKEIxNhskQkosOD0bKEI=?=")))
277
+ ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape("=?ISO-2022-JP?B?GyRCOl8kTiQzJE47fjRWJEckTyRJJCYkKyRKGyhC?=")))
278
+ end
279
+ end
280
+ end
281
+ end
282
+
258
283
  context "with attachments" do
259
284
  before(:each) do
260
285
  @mobile = Jpmobile::Mobile::AbstractMobile.new(nil, nil)
@@ -278,6 +303,14 @@ describe "Jpmobile::Mail" do
278
303
  @mail.to_s
279
304
  }.should_not raise_error
280
305
  end
306
+
307
+ it "should encodes itself successfully with an UTF-8 filename attachment" do
308
+ @mail.attachments.inline['日本語のファイル名です.jpg'] = @photo
309
+
310
+ lambda {
311
+ @mail.to_s
312
+ }.should_not raise_error
313
+ end
281
314
  end
282
315
 
283
316
  context "encoding conversion" do
@@ -300,4 +333,57 @@ describe "Jpmobile::Mail" do
300
333
  ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\x31\x30\x3a\x30\x30\x1b\x24\x42\x21\x41\x1b\x28\x42\x31\x32\x3a\x30\x30"))))
301
334
  end
302
335
  end
336
+
337
+ context "delivering" do
338
+ before(:each) do
339
+ @mobile = Jpmobile::Mobile::AbstractMobile.new(nil, nil)
340
+ @mail.mobile = @mobile
341
+ @mail.to = "むすめふさほせ <info+to@jpmobile-rails.org>"
342
+ end
343
+
344
+ it "delivers through SMTP" do
345
+ @mail.delivery_method :smtp, {:enable_starttls_auto => false}
346
+ lambda {
347
+ @mail.deliver
348
+ }.should_not raise_error
349
+
350
+ Mail::TestMailer.deliveries.size
351
+ end
352
+ end
353
+
354
+ context 'sending with carrier from' do
355
+ before do
356
+ @mail = Mail.new
357
+ @mail.subject = "万葉"
358
+ @mail.to = "ちはやふる <info@jpmobile-rails.org>"
359
+ end
360
+
361
+ it 'should convert content-transfer-encoding' do
362
+ mobile = Jpmobile::Mobile::Au.new(nil, nil)
363
+ @mail.content_transfer_encoding = 'base64'
364
+ @mail.body = ['ほげ'].pack('m')
365
+ @mail.charset = 'UTF-8'
366
+
367
+ @mail.mobile = mobile
368
+ @mail.from = '<えーゆー> au@ezweb.ne.jp'
369
+
370
+ @mail.encoded.should match(/content-transfer-encoding: 7bit/i)
371
+ end
372
+
373
+ it 'should not convert content-transfer-encoding with BINARY' do
374
+ mobile = Jpmobile::Mobile::Au.new(nil, nil)
375
+ data = ['ほげ'].pack('m').strip
376
+
377
+ @mail.content_transfer_encoding = 'base64'
378
+ @mail.content_type = 'image/jpeg'
379
+ @mail.body = data
380
+ @mail.charset = 'UTF-8'
381
+
382
+ @mail.mobile = mobile
383
+ @mail.from = '<えーゆー> au@ezweb.ne.jp'
384
+
385
+ @mail.encoded.should match(/content-transfer-encoding: base64/i)
386
+ @mail.encoded.should match(data)
387
+ end
388
+ end
303
389
  end
@@ -148,6 +148,14 @@ describe "Jpmobile::Mail#receive" do
148
148
  end
149
149
  end
150
150
  end
151
+
152
+ context 'bounced mail' do
153
+ it 'should parse sub-part charset correctly' do
154
+ @mail = Mail.new(open(File.join(File.expand_path(File.dirname(__FILE__)), "email-fixtures/bounce_with_utf8_part.eml")).read)
155
+ @mail.parts.first.charset.should match(/iso-2022-jp/i)
156
+ @mail.parts.last.charset.should match(/utf-8/i)
157
+ end
158
+ end
151
159
  end
152
160
 
153
161
  describe "Docomo" do
@@ -220,6 +228,32 @@ describe "Jpmobile::Mail#receive" do
220
228
  ascii_8bit(@mail.to_s).should match(Regexp.compile(Regexp.escape(ascii_8bit("\x1b\x24\x42\x32\x71\x35\x44\x24\x2C\x33\x2B\x3A\x45\x75\x48\x1b\x28\x42"))))
221
229
  end
222
230
  end
231
+
232
+ context 'From au iPhone' do
233
+ it 'charset should be UTF-8' do
234
+ @mail = Mail.new(open(File.join(File.expand_path(File.dirname(__FILE__)), "email-fixtures/iphone-message.eml")).read)
235
+ @mail.mobile.should be_a(Jpmobile::Mobile::Au)
236
+ @mail.charset.should match(/utf-8/i)
237
+ end
238
+
239
+ it 'should be encoded correctly' do
240
+ @mail = Mail.new(open(File.join(File.expand_path(File.dirname(__FILE__)), "email-fixtures/iphone-message.eml")).read)
241
+ @mail.encoded
242
+ end
243
+ end
244
+
245
+ context 'From iPad' do
246
+ it 'charset should be UTF-8' do
247
+ @mail = Mail.new(open(File.join(File.expand_path(File.dirname(__FILE__)), "email-fixtures/iphone-mail3.eml")).read)
248
+ @mail.mobile.should be_a(Jpmobile::Mobile::AbstractMobile)
249
+ @mail.charset.should match(/utf-8/i)
250
+ end
251
+
252
+ it 'should be encoded correctly' do
253
+ @mail = Mail.new(open(File.join(File.expand_path(File.dirname(__FILE__)), "email-fixtures/iphone-mail3.eml")).read)
254
+ @mail.encoded
255
+ end
256
+ end
223
257
  end
224
258
 
225
259
  describe "Softbank" do
@@ -288,6 +322,18 @@ describe "Jpmobile::Mail#receive" do
288
322
  end
289
323
  end
290
324
 
325
+ describe 'bounced mail' do
326
+ context "has jp address" do
327
+ before(:each) do
328
+ @mail = Mail.new(open(File.join(File.expand_path(File.dirname(__FILE__)), "../../test/rails/overrides/spec/fixtures/mobile_mailer/bounced-jp.eml")).read)
329
+ end
330
+
331
+ it "mobile should abstract mobile" do
332
+ @mail.mobile.should be_a Jpmobile::Mobile::AbstractMobile
333
+ end
334
+ end
335
+ end
336
+
291
337
  describe "non-Japanese mail" do
292
338
  context "us-ascii" do
293
339
  before(:each) do
@@ -132,4 +132,18 @@ describe Jpmobile::Util do
132
132
  hash[0xE6FB].should == 0x1F526
133
133
  end
134
134
  end
135
+
136
+ describe 'check_charset' do
137
+ it 'returns true if compatible' do
138
+ str = ascii_8bit('ABC')
139
+ check_charset(str, 'UTF-8').should be_true
140
+ end
141
+ end
142
+
143
+ describe 'correct_encoding' do
144
+ it 'updates encoding correctly' do
145
+ str = jis('再現')
146
+ utf8?(correct_encoding(str)).should be_true
147
+ end
148
+ end
135
149
  end
@@ -0,0 +1,72 @@
1
+ Return-Path: <>
2
+ X-Original-To: info@example.jp
3
+ Delivered-To: info@example.jp
4
+ Received: by localhost (Postfix)
5
+ id 081F8161D92; Fri, 17 Aug 2012 23:05:01 +0900 (JST)
6
+ Date: Fri, 17 Aug 2012 23:05:01 +0900 (JST)
7
+ From: MAILER-DAEMON@example.jp (Mail Delivery System)
8
+ Subject: Undelivered Mail Returned to Sender
9
+ To: info@example.jp
10
+ Auto-Submitted: auto-replied
11
+ MIME-Version: 1.0
12
+ Content-Type: multipart/report; report-type=delivery-status;
13
+ boundary="EAE03161D91.1345212301/localhost"
14
+ Message-Id: <20120817140501.081F8161D92@localhost>
15
+
16
+ This is a MIME-encapsulated message.
17
+
18
+ --EAE03161D91.1345212301/localhost
19
+ Content-Description: Notification
20
+ Content-Type: text/plain; charset=us-ascii
21
+
22
+ This is the mail system at host localhost.
23
+
24
+ I'm sorry to have to inform you that your message could not
25
+ be delivered to one or more recipients. It's attached below.
26
+
27
+ For further assistance, please send mail to postmaster.
28
+
29
+ If you do so, please include this problem report. You can
30
+ delete your own text from the attached returned message.
31
+
32
+ The mail system
33
+
34
+ <unknown@docomo.ne.jp>: host mfsmax.docomo.ne.jp[203.138.181.112] said: 550
35
+ Unknown user unknown@docomo.ne.jp (in reply to end of DATA command)
36
+
37
+ --EAE03161D91.1345212301/localhost
38
+ Content-Description: Delivery report
39
+ Content-Type: message/delivery-status
40
+
41
+ Reporting-MTA: dns; localhost
42
+ X-Postfix-Queue-ID: EAE03161D91
43
+ X-Postfix-Sender: rfc822; info@example.jp
44
+ Arrival-Date: Fri, 17 Aug 2012 23:05:00 +0900 (JST)
45
+
46
+ Final-Recipient: rfc822; unknown@docomo.ne.jp
47
+ Action: failed
48
+ Status: 5.0.0
49
+ Remote-MTA: dns; mfsmax.docomo.ne.jp
50
+ Diagnostic-Code: smtp; 550 Unknown user unknown@docomo.ne.jp
51
+
52
+ --EAE03161D91.1345212301/localhost
53
+ Content-Description: Undelivered Message
54
+ Content-Type: message/rfc822
55
+
56
+ Return-Path: <info@example.jp>
57
+ Received: by localhost (Postfix, from userid 1004)
58
+ id EAE03161D91; Fri, 17 Aug 2012 23:05:00 +0900 (JST)
59
+ Date: Fri, 17 Aug 2012 23:05:00 +0900
60
+ From: info@example.jp
61
+ To: unknown@docomo.ne.jp
62
+ Message-ID: <502e4f8c8dc0a_1ed1cbf30467885@mail>
63
+ Subject: =?Shift_JIS?B?dGVzdA==?=
64
+ Mime-Version: 1.0
65
+ Content-Type: text/plain;
66
+ charset=Shift_JIS
67
+ Content-Transfer-Encoding: 7bit
68
+
69
+ test
70
+
71
+ --EAE03161D91.1345212301/localhost--
72
+
@@ -663,6 +663,15 @@ describe MobileMailer, "receiving" do
663
663
  parts.first.body.should match(/テストです&#xe595;/)
664
664
  parts.last.body.raw_source.should match(/テストです&#xe595;/)
665
665
  end
666
+
667
+ context 'iPhone' do
668
+ it 'should parse correctly' do
669
+ lambda {
670
+ @mail = MobileMailer.receive(open(File.join(Rails.root, "../../../spec/unit/email-fixtures/iphone-message.eml")).read)
671
+ @mail.encoded
672
+ }.should_not raise_error
673
+ end
674
+ end
666
675
  end
667
676
 
668
677
  describe "softbank(sjis) の場合" do
metadata CHANGED
@@ -1,295 +1,297 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: jpmobile
3
- version: !ruby/object:Gem::Version
4
- hash: 3
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.11
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 10
10
- version: 1.0.10
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Yoji Shidara
14
9
  - Shin-ichiro OGAWA
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2012-08-10 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 0
30
- version: "0"
31
- prerelease: false
13
+ date: 2012-10-09 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
32
16
  name: jeweler
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
33
23
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ! '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '0'
31
+ - !ruby/object:Gem::Dependency
32
+ name: rails
33
+ requirement: !ruby/object:Gem::Requirement
37
34
  none: false
38
- requirements:
35
+ requirements:
39
36
  - - ~>
40
- - !ruby/object:Gem::Version
41
- hash: 37
42
- segments:
43
- - 3
44
- - 0
45
- - 17
37
+ - !ruby/object:Gem::Version
46
38
  version: 3.0.17
47
- prerelease: false
48
- name: rails
49
39
  type: :development
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
53
42
  none: false
54
- requirements:
43
+ requirements:
55
44
  - - ~>
56
- - !ruby/object:Gem::Version
57
- hash: 23
58
- segments:
59
- - 2
60
- - 6
61
- - 0
62
- version: 2.6.0
63
- prerelease: false
45
+ - !ruby/object:Gem::Version
46
+ version: 3.0.17
47
+ - !ruby/object:Gem::Dependency
64
48
  name: rspec
65
- type: :development
66
- version_requirements: *id003
67
- - !ruby/object:Gem::Dependency
68
- requirement: &id004 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
69
50
  none: false
70
- requirements:
51
+ requirements:
71
52
  - - ~>
72
- - !ruby/object:Gem::Version
73
- hash: 23
74
- segments:
75
- - 2
76
- - 6
77
- - 0
53
+ - !ruby/object:Gem::Version
78
54
  version: 2.6.0
55
+ type: :development
79
56
  prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: 2.6.0
63
+ - !ruby/object:Gem::Dependency
80
64
  name: rspec-rails
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ~>
69
+ - !ruby/object:Gem::Version
70
+ version: 2.6.0
81
71
  type: :development
82
- version_requirements: *id004
83
- - !ruby/object:Gem::Dependency
84
- requirement: &id005 !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- hash: 3
90
- segments:
91
- - 0
92
- version: "0"
93
72
  prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ~>
77
+ - !ruby/object:Gem::Version
78
+ version: 2.6.0
79
+ - !ruby/object:Gem::Dependency
94
80
  name: webrat
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
95
87
  type: :development
96
- version_requirements: *id005
97
- - !ruby/object:Gem::Dependency
98
- requirement: &id006 !ruby/object:Gem::Requirement
99
- none: false
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
- version: "0"
107
88
  prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ - !ruby/object:Gem::Dependency
108
96
  name: geokit
97
+ requirement: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
109
103
  type: :development
110
- version_requirements: *id006
111
- - !ruby/object:Gem::Dependency
112
- requirement: &id007 !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- hash: 3
118
- segments:
119
- - 0
120
- version: "0"
121
104
  prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
122
112
  name: sqlite3-ruby
113
+ requirement: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
123
119
  type: :development
124
- version_requirements: *id007
125
- - !ruby/object:Gem::Dependency
126
- requirement: &id008 !ruby/object:Gem::Requirement
127
- none: false
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- hash: 3
132
- segments:
133
- - 0
134
- version: "0"
135
120
  prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ! '>='
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ - !ruby/object:Gem::Dependency
136
128
  name: hpricot
129
+ requirement: !ruby/object:Gem::Requirement
130
+ none: false
131
+ requirements:
132
+ - - ! '>='
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
137
135
  type: :development
138
- version_requirements: *id008
139
- - !ruby/object:Gem::Dependency
140
- requirement: &id009 !ruby/object:Gem::Requirement
141
- none: false
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- hash: 1
146
- segments:
147
- - 1
148
- - 5
149
- - 1
150
- version: 1.5.1
151
136
  prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ - !ruby/object:Gem::Dependency
152
144
  name: jeweler
145
+ requirement: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ! '>='
149
+ - !ruby/object:Gem::Version
150
+ version: 1.5.1
153
151
  type: :development
154
- version_requirements: *id009
155
- - !ruby/object:Gem::Dependency
156
- requirement: &id010 !ruby/object:Gem::Requirement
157
- none: false
158
- requirements:
159
- - - ">="
160
- - !ruby/object:Gem::Version
161
- hash: 3
162
- segments:
163
- - 2
164
- - 3
165
- - 0
166
- version: 2.3.0
167
152
  prerelease: false
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ! '>='
157
+ - !ruby/object:Gem::Version
158
+ version: 1.5.1
159
+ - !ruby/object:Gem::Dependency
168
160
  name: rspec
169
- type: :development
170
- version_requirements: *id010
171
- - !ruby/object:Gem::Dependency
172
- requirement: &id011 !ruby/object:Gem::Requirement
173
- none: false
174
- requirements:
175
- - - ">="
176
- - !ruby/object:Gem::Version
177
- hash: 3
178
- segments:
179
- - 2
180
- - 3
181
- - 0
161
+ requirement: !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ! '>='
165
+ - !ruby/object:Gem::Version
182
166
  version: 2.3.0
167
+ type: :development
183
168
  prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
170
+ none: false
171
+ requirements:
172
+ - - ! '>='
173
+ - !ruby/object:Gem::Version
174
+ version: 2.3.0
175
+ - !ruby/object:Gem::Dependency
184
176
  name: rspec-rails
177
+ requirement: !ruby/object:Gem::Requirement
178
+ none: false
179
+ requirements:
180
+ - - ! '>='
181
+ - !ruby/object:Gem::Version
182
+ version: 2.3.0
185
183
  type: :development
186
- version_requirements: *id011
187
- - !ruby/object:Gem::Dependency
188
- requirement: &id012 !ruby/object:Gem::Requirement
189
- none: false
190
- requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- hash: 7
194
- segments:
195
- - 0
196
- - 7
197
- - 2
198
- version: 0.7.2
199
184
  prerelease: false
185
+ version_requirements: !ruby/object:Gem::Requirement
186
+ none: false
187
+ requirements:
188
+ - - ! '>='
189
+ - !ruby/object:Gem::Version
190
+ version: 2.3.0
191
+ - !ruby/object:Gem::Dependency
200
192
  name: webrat
193
+ requirement: !ruby/object:Gem::Requirement
194
+ none: false
195
+ requirements:
196
+ - - ! '>='
197
+ - !ruby/object:Gem::Version
198
+ version: 0.7.2
201
199
  type: :development
202
- version_requirements: *id012
203
- - !ruby/object:Gem::Dependency
204
- requirement: &id013 !ruby/object:Gem::Requirement
205
- none: false
206
- requirements:
207
- - - ">="
208
- - !ruby/object:Gem::Version
209
- hash: 3
210
- segments:
211
- - 1
212
- - 5
213
- - 0
214
- version: 1.5.0
215
200
  prerelease: false
201
+ version_requirements: !ruby/object:Gem::Requirement
202
+ none: false
203
+ requirements:
204
+ - - ! '>='
205
+ - !ruby/object:Gem::Version
206
+ version: 0.7.2
207
+ - !ruby/object:Gem::Dependency
216
208
  name: geokit
209
+ requirement: !ruby/object:Gem::Requirement
210
+ none: false
211
+ requirements:
212
+ - - ! '>='
213
+ - !ruby/object:Gem::Version
214
+ version: 1.5.0
217
215
  type: :development
218
- version_requirements: *id013
219
- - !ruby/object:Gem::Dependency
220
- requirement: &id014 !ruby/object:Gem::Requirement
221
- none: false
222
- requirements:
223
- - - ">="
224
- - !ruby/object:Gem::Version
225
- hash: 31
226
- segments:
227
- - 1
228
- - 3
229
- - 2
230
- version: 1.3.2
231
216
  prerelease: false
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ none: false
219
+ requirements:
220
+ - - ! '>='
221
+ - !ruby/object:Gem::Version
222
+ version: 1.5.0
223
+ - !ruby/object:Gem::Dependency
232
224
  name: sqlite3-ruby
225
+ requirement: !ruby/object:Gem::Requirement
226
+ none: false
227
+ requirements:
228
+ - - ! '>='
229
+ - !ruby/object:Gem::Version
230
+ version: 1.3.2
233
231
  type: :development
234
- version_requirements: *id014
235
- - !ruby/object:Gem::Dependency
236
- requirement: &id015 !ruby/object:Gem::Requirement
237
- none: false
238
- requirements:
239
- - - ">="
240
- - !ruby/object:Gem::Version
241
- hash: 57
242
- segments:
243
- - 0
244
- - 8
245
- - 3
246
- version: 0.8.3
247
232
  prerelease: false
233
+ version_requirements: !ruby/object:Gem::Requirement
234
+ none: false
235
+ requirements:
236
+ - - ! '>='
237
+ - !ruby/object:Gem::Version
238
+ version: 1.3.2
239
+ - !ruby/object:Gem::Dependency
248
240
  name: hpricot
241
+ requirement: !ruby/object:Gem::Requirement
242
+ none: false
243
+ requirements:
244
+ - - ! '>='
245
+ - !ruby/object:Gem::Version
246
+ version: 0.8.3
249
247
  type: :development
250
- version_requirements: *id015
251
- - !ruby/object:Gem::Dependency
252
- requirement: &id016 !ruby/object:Gem::Requirement
253
- none: false
254
- requirements:
255
- - - ">="
256
- - !ruby/object:Gem::Version
257
- hash: 21
258
- segments:
259
- - 1
260
- - 2
261
- - 5
262
- version: 1.2.5
263
248
  prerelease: false
249
+ version_requirements: !ruby/object:Gem::Requirement
250
+ none: false
251
+ requirements:
252
+ - - ! '>='
253
+ - !ruby/object:Gem::Version
254
+ version: 0.8.3
255
+ - !ruby/object:Gem::Dependency
264
256
  name: git
257
+ requirement: !ruby/object:Gem::Requirement
258
+ none: false
259
+ requirements:
260
+ - - ! '>='
261
+ - !ruby/object:Gem::Version
262
+ version: 1.2.5
265
263
  type: :development
266
- version_requirements: *id016
267
- - !ruby/object:Gem::Dependency
268
- requirement: &id017 !ruby/object:Gem::Requirement
269
- none: false
270
- requirements:
271
- - - ">="
272
- - !ruby/object:Gem::Version
273
- hash: 1
274
- segments:
275
- - 3
276
- - 0
277
- - 3
278
- version: 3.0.3
279
264
  prerelease: false
265
+ version_requirements: !ruby/object:Gem::Requirement
266
+ none: false
267
+ requirements:
268
+ - - ! '>='
269
+ - !ruby/object:Gem::Version
270
+ version: 1.2.5
271
+ - !ruby/object:Gem::Dependency
280
272
  name: rails
273
+ requirement: !ruby/object:Gem::Requirement
274
+ none: false
275
+ requirements:
276
+ - - ! '>='
277
+ - !ruby/object:Gem::Version
278
+ version: 3.0.3
281
279
  type: :development
282
- version_requirements: *id017
280
+ prerelease: false
281
+ version_requirements: !ruby/object:Gem::Requirement
282
+ none: false
283
+ requirements:
284
+ - - ! '>='
285
+ - !ruby/object:Gem::Version
286
+ version: 3.0.3
283
287
  description: A Rails plugin for Japanese mobile-phones
284
288
  email: dara@shidara.net
285
289
  executables: []
286
-
287
290
  extensions: []
288
-
289
- extra_rdoc_files:
291
+ extra_rdoc_files:
290
292
  - README
291
293
  - README.rdoc
292
- files:
294
+ files:
293
295
  - .rspec
294
296
  - CHANGELOG
295
297
  - Gemfile
@@ -374,9 +376,12 @@ files:
374
376
  - spec/unit/email-fixtures/au-emoji.eml
375
377
  - spec/unit/email-fixtures/au-emoji2.eml
376
378
  - spec/unit/email-fixtures/au-emoji5.eml
379
+ - spec/unit/email-fixtures/bounce_with_utf8_part.eml
377
380
  - spec/unit/email-fixtures/docomo-emoji.eml
378
381
  - spec/unit/email-fixtures/docomo-gmail-sjis.eml
379
382
  - spec/unit/email-fixtures/docomo-jis.eml
383
+ - spec/unit/email-fixtures/iphone-mail3.eml
384
+ - spec/unit/email-fixtures/iphone-message.eml
380
385
  - spec/unit/email-fixtures/pc-mail-multi.eml
381
386
  - spec/unit/email-fixtures/pc-mail-single.eml
382
387
  - spec/unit/email-fixtures/photo.jpg
@@ -480,6 +485,7 @@ files:
480
485
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-emoji.eml
481
486
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-emoji2.eml
482
487
  - test/rails/overrides/spec/fixtures/mobile_mailer/au-emoji5.eml
488
+ - test/rails/overrides/spec/fixtures/mobile_mailer/bounced-jp.eml
483
489
  - test/rails/overrides/spec/fixtures/mobile_mailer/docomo-emoji.eml
484
490
  - test/rails/overrides/spec/fixtures/mobile_mailer/docomo-gmail-sjis.eml
485
491
  - test/rails/overrides/spec/fixtures/mobile_mailer/docomo-jis.eml
@@ -520,36 +526,26 @@ files:
520
526
  - tools/list_gps_unsupported_au.rb
521
527
  homepage: http://jpmobile-rails.org
522
528
  licenses: []
523
-
524
529
  post_install_message:
525
530
  rdoc_options: []
526
-
527
- require_paths:
531
+ require_paths:
528
532
  - lib
529
- required_ruby_version: !ruby/object:Gem::Requirement
533
+ required_ruby_version: !ruby/object:Gem::Requirement
530
534
  none: false
531
- requirements:
532
- - - ">="
533
- - !ruby/object:Gem::Version
534
- hash: 3
535
- segments:
536
- - 0
537
- version: "0"
538
- required_rubygems_version: !ruby/object:Gem::Requirement
535
+ requirements:
536
+ - - ! '>='
537
+ - !ruby/object:Gem::Version
538
+ version: '0'
539
+ required_rubygems_version: !ruby/object:Gem::Requirement
539
540
  none: false
540
- requirements:
541
- - - ">="
542
- - !ruby/object:Gem::Version
543
- hash: 3
544
- segments:
545
- - 0
546
- version: "0"
541
+ requirements:
542
+ - - ! '>='
543
+ - !ruby/object:Gem::Version
544
+ version: '0'
547
545
  requirements: []
548
-
549
546
  rubyforge_project:
550
547
  rubygems_version: 1.8.24
551
548
  signing_key:
552
549
  specification_version: 3
553
550
  summary: A Rails plugin for Japanese mobile-phones
554
551
  test_files: []
555
-