summaryrefslogtreecommitdiff
path: root/lib/feed2imap/imap.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feed2imap/imap.rb')
-rw-r--r--lib/feed2imap/imap.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/feed2imap/imap.rb b/lib/feed2imap/imap.rb
index c4e7106..60775e2 100644
--- a/lib/feed2imap/imap.rb
+++ b/lib/feed2imap/imap.rb
@@ -108,7 +108,7 @@ class ImapAccount
end
# update a mail
- def updatemail(folder, mail, id, date = Time::now)
+ def updatemail(folder, mail, id, date = Time::now, reupload_if_updated = true)
create_folder_if_not_exists(folder)
@connection.select(folder)
searchres = @connection.search(['HEADER', 'Message-Id', id])
@@ -119,6 +119,9 @@ class ImapAccount
searchres.each { |m| @connection.store(m, "+FLAGS", [:Deleted]) }
@connection.expunge
flags -= [ :Recent ] # avoids errors with dovecot
+ elsif not reupload_if_updated
+ # mail not present, and we don't want to re-upload it
+ return
end
@connection.append(folder, mail.gsub(/\n/, "\r\n"), flags, date)
end