vmail 2.5.9 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,9 +61,14 @@ module Vmail
61
61
  headers = format_headers headers_hash
62
62
  # replace the date value with the one derived from the envelope
63
63
  body = formatter.plaintext_part
64
- conv_from = /charset=(.*)\s/.match(parts_list)[1].strip
65
- body.force_encoding conv_from
66
- body = body.encode!('utf-8', undef: :replace, invalid: :replace)
64
+ if /charset=(.*)\s/.match(parts_list)
65
+ conv_from = /charset=(.*)\s/.match(parts_list)[1].strip
66
+ body.force_encoding conv_from
67
+ body = body.encode!('utf-8', undef: :replace, invalid: :replace)
68
+ else
69
+ body.force_encoding "utf-8"
70
+ body = body.encode!('us-ascii', undef: :replace, invalid: :replace)
71
+ end
67
72
  message_text = <<-EOF
68
73
  #{message_id} #{number_to_human_size message.size} #{message.flags} #{parts_list}
69
74
  #{divider '-'}
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = '2.5.9'
2
+ VERSION = '2.6.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.9
4
+ version: 2.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: