summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/itemtomail.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb
index 8744021..ec3bbfb 100644
--- a/lib/feed2imap/itemtomail.rb
+++ b/lib/feed2imap/itemtomail.rb
@@ -51,18 +51,14 @@ 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?('@')
- hdr_from = item.creator.chomp
+ message.header['From'] = item.creator.chomp
else
- hdr_from = "#{item.creator.chomp} <feed2imap@acme.com>"
+ message.header['From'] = "=?utf-8?b?#{Base64::encode64(item.creator.chomp).gsub("\n",'')}?= <feed2imap@acme.com>"
end
else
- hdr_from = "#{from} <feed2imap@acme.com>"
+ message.header['From'] = "=?utf-8?b?#{Base64::encode64(from).gsub("\n",'')}?= <feed2imap@acme.com>"
end
-
- 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)}?="
+ message.header['To'] = "=?utf-8?b?#{Base64::encode64(from).gsub("\n",'')}?= <feed2imap@acme.com>"
if item.date.nil?
message.header['Date'] = Time::new.rfc2822