summaryrefslogtreecommitdiff
path: root/lib/feed2imap/maildir.rb
diff options
context:
space:
mode:
authorLucas Nussbaum <lucas@lucas-nussbaum.net>2010-11-30 22:15:18 +0100
committerLucas Nussbaum <lucas@lucas-nussbaum.net>2010-11-30 22:15:18 +0100
commit53fd75a9521fef988fa4dd3dc584a6f57b4bda8e (patch)
tree3434566900c3c4db73a60224bcee6b0ddad8db16 /lib/feed2imap/maildir.rb
parentc46c823aff3ad63fbc62c2281ac4fddb0bcb1e21 (diff)
downloadfeed2imap-53fd75a9521fef988fa4dd3dc584a6f57b4bda8e.tar.gz
feed2imap-53fd75a9521fef988fa4dd3dc584a6f57b4bda8e.tar.bz2
feed2imap-53fd75a9521fef988fa4dd3dc584a6f57b4bda8e.zip
Also add reupload_if_updated for Maildirs
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/maildir.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/feed2imap/maildir.rb b/lib/feed2imap/maildir.rb
index 76678e2..317f631 100644
--- a/lib/feed2imap/maildir.rb
+++ b/lib/feed2imap/maildir.rb
@@ -35,7 +35,7 @@ class MaildirAccount
end
end
- def updatemail(folder, mail, idx, date = Time::now)
+ def updatemail(folder, mail, idx, date = Time::now, reupload_if_updated = true)
dir = folder_dir(folder)
guarantee_maildir(dir)
mail_files = find_mails(dir, idx)
@@ -44,6 +44,9 @@ class MaildirAccount
# get the info from the first result and delete everything
info = maildir_file_info(mail_files[0])
mail_files.each { |f| File.delete(File.join(dir, f)) }
+ elsif not reupload_if_updated
+ # mail not present, and we don't want to re-upload it
+ return
end
store_message(dir, date, info) { |f| f.puts(mail) }
end