Fixes issue #141 - infinite loop for IMAP after

certain return codes.
Thanks to Walter Doekes for the patch.
This commit is contained in:
Ross Poulton 2010-07-16 07:50:08 +00:00
parent c892699744
commit f51eabeae8

View File

@ -112,11 +112,10 @@ def process_queue(q, quiet=False):
server.login(q.email_box_user, q.email_box_pass)
server.select(q.email_box_imap_folder)
while True:
status, data = server.search(None, 'NOT', 'DELETED')
status, data = server.search(None, 'NOT', 'DELETED')
if data:
msgnums = data[0].split()
if not msgnums:
break
for num in msgnums:
status, data = server.fetch(num, '(RFC822)')
ticket = ticket_from_message(message=data[0][1], queue=q, quiet=quiet)