Permalink
Browse files

Make script work with empty IMAP folders.

  • Loading branch information...
1 parent efb5d81 commit 545b6ad5be07bbc9f5491fa77bb5cbe91f6d8537 Fábio Melo Pfeifer committed Mar 19, 2013
Showing with 5 additions and 1 deletion.
  1. +5 −1 nopriv.py
View
@@ -215,7 +215,11 @@ def get_messages_to_local_maildir(mailFolder, mail, startid = 1):
exit()
total_messages_in_mailbox = len(mdata[0].split())
- last_mail_id = mdata[0].split()[-1]
+ last_mail_id = 0
+ try:
+ last_mail_id = mdata[0].split()[-1]
+ except Exception:
+ pass
folder_most_recent_id = getLastMailID(mailFolder, IMAPLOGIN)
if folder_most_recent_id > 2 and incremental_backup == True:

0 comments on commit 545b6ad

Please sign in to comment.