From 2e52bcdafec3e7ec5c9eacf8c2405274178ef174 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Tue, 16 May 2006 04:30:48 +0100 Subject: [PATCH] failure to obtain uid indicated by savemessage_searchforheader return value <= 0, not ValueError --- offlineimap/folder/IMAP.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 0bf58e8..41c6982 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -231,11 +231,10 @@ class IMAPFolder(BaseFolder): assert(imapobj.check()[0] == 'OK') # Keep trying until we get the UID. - try: - ui.debug('imap', 'savemessage: first attempt to get new UID') - uid = self.savemessage_searchforheader(imapobj, headername, - headervalue) - except ValueError: + ui.debug('imap', 'savemessage: first attempt to get new UID') + uid = self.savemessage_searchforheader(imapobj, headername, + headervalue) + if uid <= 0: ui.debug('imap', 'savemessage: first attempt to get new UID failed. Going to run a NOOP and try again.') assert(imapobj.noop()[0] == 'OK') uid = self.savemessage_searchforheader(imapobj, headername,