mailcatcher 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/mail_catcher/mail.rb +4 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/mail_catcher/mail.rb
CHANGED
@@ -42,9 +42,11 @@ module MailCatcher::Mail
|
|
42
42
|
mail = Mail.new(message[:source])
|
43
43
|
result = @@add_message_query.execute(message[:sender], message[:recipients].inspect, mail.subject, message[:source], message[:source].length)
|
44
44
|
message_id = db.last_insert_row_id
|
45
|
-
(mail.all_parts || [mail]).each do |part|
|
45
|
+
(mail.all_parts.presence || [mail]).each do |part|
|
46
46
|
body = part.body.to_s
|
47
|
-
|
47
|
+
# Only parts have CIDs, not mail
|
48
|
+
cid = part.cid if part.respond_to? :cid
|
49
|
+
add_message_part(message_id, cid, part.mime_type || 'text/plain', part.attachment? ? 1 : 0, part.filename, part.charset, body, body.length)
|
48
50
|
end
|
49
51
|
|
50
52
|
EventMachine.next_tick do
|