summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/feed2imap/itemtomail.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb
index 27fc362..8744021 100644
--- a/lib/feed2imap/itemtomail.rb
+++ b/lib/feed2imap/itemtomail.rb
@@ -51,14 +51,19 @@ def item_to_mail(item, index, updated, from = 'Feed2Imap', inline_images = false
message = RMail::Message::new
if item.creator and item.creator != ''
if item.creator.include?('@')
- message.header['From'] = item.creator.chomp
+ hdr_from = item.creator.chomp
else
- message.header['From'] = "#{item.creator.chomp} <feed2imap@acme.com>"
+ hdr_from = "#{item.creator.chomp} <feed2imap@acme.com>"
end
else
- message.header['From'] = "#{from} <feed2imap@acme.com>"
+ hdr_from = "#{from} <feed2imap@acme.com>"
end
- message.header['To'] = "#{from} <feed2imap@acme.com>"
+
+ hdr_to = "#{from} <feed2imap@acme.com>"
+
+ message.header['From'] = "=?utf-8?b?#{Base64::encode64(hdr_from)}?="
+ message.header['To'] = "=?utf-8?b?#{Base64::encode64(hdr_to)}?="
+
if item.date.nil?
message.header['Date'] = Time::new.rfc2822
else
@@ -73,7 +78,7 @@ def item_to_mail(item, index, updated, from = 'Feed2Imap', inline_images = false
if subj.needMIME
message.header['Subject'] = "=?utf-8?b?#{Base64::encode64(subj).gsub("\n",'')}?="
else
- message.header['Subject'] = subj
+ message.header['Subject'] = subj
end
end
textpart = RMail::Message::new