vmail 1.9.8 → 1.9.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,7 @@ module Vmail
22
22
  results.reverse.map do |x|
23
23
  envelope = x.attr["ENVELOPE"]
24
24
  message_id = envelope.message_id
25
- subject = Mail::Encodings.unquote_and_convert_to(envelope.subject, 'UTF-8')
25
+ subject = Mail::Encodings.unquote_and_convert_to((envelope.subject || ''), 'UTF-8')
26
26
  recipients = ((envelope.to || []) + (envelope.cc || [])).map {|a| extract_address(a)}.join(', ')
27
27
  sender = extract_address envelope.from.first
28
28
  uid = x.attr["UID"]
@@ -55,13 +55,15 @@ module Vmail
55
55
  def extract_address(address_struct)
56
56
  address = if address_struct.nil?
57
57
  "Unknown"
58
- elsif address_struct.name
59
- "#{Mail::Encodings.unquote_and_convert_to(address_struct.name, 'UTF-8')} <#{[address_struct.mailbox, address_struct.host].join('@')}>"
60
- else
61
- [
62
- (address_struct.mailbox ? Mail::Encodings.unquote_and_convert_to(address_struct.mailbox, 'UTF-8') : ""),
63
- (address_struct.host ? Mail::Encodings.unquote_and_convert_to(address_struct.host, 'UTF-8'): "")
64
- ].join('@')
58
+ else
59
+ email = [ (address_struct.mailbox ? Mail::Encodings.unquote_and_convert_to(address_struct.mailbox, 'UTF-8') : ""),
60
+ (address_struct.host ? Mail::Encodings.unquote_and_convert_to(address_struct.host, 'UTF-8'): "")
61
+ ].join('@')
62
+ if address_struct.name
63
+ "#{Mail::Encodings.unquote_and_convert_to((address_struct.name || ''), 'UTF-8')} <#{email}>"
64
+ else
65
+ email
66
+ end
65
67
  end
66
68
 
67
69
  end
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = '1.9.8'
2
+ VERSION = '1.9.9'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vmail
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.9.8
5
+ version: 1.9.9
6
6
  platform: ruby
7
7
  authors:
8
8
  - Daniel Choi