From bdf098cb5c32723de559f6bb559866802cdb6367 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Fri, 25 Mar 2016 22:40:35 +0100 Subject: images are now rendered inline, no need for the multipart handling --- lib/feed2imap/itemtomail.rb | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'lib/feed2imap') diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb index 63445b0..8cde250 100644 --- a/lib/feed2imap/itemtomail.rb +++ b/lib/feed2imap/itemtomail.rb @@ -89,7 +89,6 @@ def item_to_mail(config, item, id, updated, from = 'Feed2Imap', inline_images = end # inline images as attachments - imgs = [] if inline_images fetcher = HTTPFetcher.new html = htmlpart.body.decoded @@ -110,26 +109,11 @@ def item_to_mail(config, item, id, updated, from = 'Feed2Imap', inline_images = end htmlpart.body = html end - - - if imgs.length > 0 - # The old code explicitly used 'multipart/related' here, so force it - # We then have the structure "related: (alternative: text/html)/images" - # - # We could obtain easier code here, if 'alternative: text/html/images' would suffice. - message.content_type "multipart/related" - message.part do |p| - p.text_part = textpart - p.html_part = htmlpart - end - imgs.each do |i| - message.attachments[i[:name]] = i - end - else - # textpart/htmlpart are nil when not set - # Mail then ignores them if nil; if both are given it sets multipart/alternative - message.text_part = textpart - message.html_part = htmlpart - end + + # textpart/htmlpart are nil when not set + # Mail then ignores them if nil; if both are given it sets multipart/alternative + message.text_part = textpart + message.html_part = htmlpart + return message.to_s end -- cgit v1.2.3-70-g09d2