mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-25 09:23:39 +01:00
bug fix data may be referenced when not set
This commit is contained in:
parent
628b734451
commit
eca0f16806
@ -154,8 +154,6 @@ def imap_sync(q, logger, server):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
status, data = server.search(None, 'NOT', 'DELETED')
|
status, data = server.search(None, 'NOT', 'DELETED')
|
||||||
except imaplib.IMAP4.error:
|
|
||||||
logger.error("IMAP retrieve failed. Is the folder '%s' spelled correctly, and does it exist on the server?" % q.email_box_imap_folder)
|
|
||||||
if data:
|
if data:
|
||||||
msgnums = data[0].split()
|
msgnums = data[0].split()
|
||||||
logger.info("Received %d messages from IMAP server" % len(msgnums))
|
logger.info("Received %d messages from IMAP server" % len(msgnums))
|
||||||
@ -172,6 +170,8 @@ def imap_sync(q, logger, server):
|
|||||||
logger.info("Successfully processed message %s, deleted from IMAP server" % num)
|
logger.info("Successfully processed message %s, deleted from IMAP server" % num)
|
||||||
else:
|
else:
|
||||||
logger.warn("Message %s was not successfully processed, and will be left on IMAP server" % num)
|
logger.warn("Message %s was not successfully processed, and will be left on IMAP server" % num)
|
||||||
|
except imaplib.IMAP4.error:
|
||||||
|
logger.error("IMAP retrieve failed. Is the folder '%s' spelled correctly, and does it exist on the server?" % q.email_box_imap_folder)
|
||||||
|
|
||||||
server.expunge()
|
server.expunge()
|
||||||
server.close()
|
server.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user