summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/feed2imap/itemtomail.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/feed2imap/itemtomail.rb b/lib/feed2imap/itemtomail.rb
index 9d1cbad..f2c5616 100644
--- a/lib/feed2imap/itemtomail.rb
+++ b/lib/feed2imap/itemtomail.rb
@@ -43,8 +43,15 @@ end
def item_to_mail(item, index, updated, from = 'Feed2Imap')
message = RMail::Message::new
- message.header['From'] = "#{from} <feed2imap@feed2imap.net>"
- message.header['To'] = "#{from} <feed2imap@feed2imap.net>"
+ if item.creator and item.creator != ''
+ if item.creator.include?('@')
+ message.header['From'] = item.creator.chomp
+ else
+ message.header['From'] = "#{item.creator.chomp} <feed2imap@acme.com>"
+ end
+ else
+ message.header['To'] = "#{from} <feed2imap@acme.com>"
+ end
if @date.nil?
message.header['Date'] = Time::new.rfc2822
else