vmail 1.9.8 → 1.9.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/vmail/showing_headers.rb +10 -8
- data/lib/vmail/version.rb +1 -1
- metadata +1 -1
@@ -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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
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
|
data/lib/vmail/version.rb
CHANGED