diff options
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | lib/feed2imap/feed2imap.rb | 5 | ||||
-rw-r--r-- | lib/feed2imap/imap.rb | 10 |
3 files changed, 10 insertions, 7 deletions
@@ -5,6 +5,8 @@ Feed2Imap 0.7 (XX/02/2006) * Fixes some issues regarding parallel fetching of feeds. * Now displays the feed creator as sender of emails. * Don't display the password in error messages (fixes debian bug #350370). +* Upload mail with the Item's time, not the upload's time (fixes debian + bug #350371). Feed2Imap 0.6 (11/01/2006) ============================ diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb index 41c75eb..f1ba506 100644 --- a/lib/feed2imap/feed2imap.rb +++ b/lib/feed2imap/feed2imap.rb @@ -156,11 +156,12 @@ class Feed2Imap if !cacherebuild updateditems.each do |i| email = item_to_mail(i, i.cacheditem.index, true, f.name) - f.imapaccount.updatemail(f.folder, email, i.cacheditem.index) + f.imapaccount.updatemail(f.folder, email, + i.cacheditem.index, i.date || Time::new) end newitems.each do |i| email = item_to_mail(i, i.cacheditem.index, false, f.name) - f.imapaccount.putmail(f.folder, email) + f.imapaccount.putmail(f.folder, email, i.date || Time::new) end end rescue diff --git a/lib/feed2imap/imap.rb b/lib/feed2imap/imap.rb index ca81a9f..e9bbb63 100644 --- a/lib/feed2imap/imap.rb +++ b/lib/feed2imap/imap.rb @@ -94,12 +94,12 @@ class ImapAccount # Put the mail in the given folder # You should check whether the folder exist first. - def putmail(folder, mail) - @connection.append(folder, mail.gsub(/\n/, "\r\n")) + def putmail(folder, mail, date = Time::now) + @connection.append(folder, mail.gsub(/\n/, "\r\n"), [:Recent], date) end # update a mail - def updatemail(folder, mail, idx) + def updatemail(folder, mail, idx, date = Time::now) @connection.select(folder) searchres = @connection.search(['HEADER', 'X-CacheIndex', "-#{idx}-"]) flags = nil @@ -109,13 +109,13 @@ class ImapAccount searchres.each { |m| @connection.store(m, "+FLAGS", [:Deleted]) } @connection.expunge end - @connection.append(folder, mail.gsub(/\n/, "\r\n"), flags) + @connection.append(folder, mail.gsub(/\n/, "\r\n"), flags, date) end # convert to string def to_s u2 = uri.clone - u2.password = nil + u2.password = 'PASSWORD' u2.to_s end |