folder: IMAP: improve error message when Dovecot returns any data for UID FETCH
Github-ref: https://github.com/OfflineIMAP/offlineimap/issues/429 Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
6c0828b77c
commit
ba52030923
@ -760,13 +760,15 @@ class IMAPFolder(BaseFolder):
|
|||||||
# exactly one response.
|
# exactly one response.
|
||||||
if res_type == 'OK':
|
if res_type == 'OK':
|
||||||
data = [res for res in data if not isinstance(res, str)]
|
data = [res for res in data if not isinstance(res, str)]
|
||||||
# Could not fetch message.
|
|
||||||
|
# Could not fetch message. Note: it is allowed by rfc3501 to return any
|
||||||
|
# data for the UID FETCH command.
|
||||||
if data == [None] or res_type != 'OK' or len(data) != 1:
|
if data == [None] or res_type != 'OK' or len(data) != 1:
|
||||||
severity = OfflineImapError.ERROR.MESSAGE
|
severity = OfflineImapError.ERROR.MESSAGE
|
||||||
reason = "IMAP server '%s' failed to fetch messages UID '%s'."\
|
reason = "IMAP server '%s' failed to fetch messages UID '%s'."\
|
||||||
" Server responded: %s %s"% (self.getrepository(), uids,
|
" Server responded: %s %s"% (self.getrepository(), uids,
|
||||||
res_type, data)
|
res_type, data)
|
||||||
if data == [None]:
|
if data == [None] or len(data) < 1:
|
||||||
# IMAP server did not find a message with this UID.
|
# IMAP server did not find a message with this UID.
|
||||||
reason = "IMAP server '%s' does not have a message "\
|
reason = "IMAP server '%s' does not have a message "\
|
||||||
"with UID '%s'"% (self.getrepository(), uids)
|
"with UID '%s'"% (self.getrepository(), uids)
|
||||||
|
Loading…
Reference in New Issue
Block a user