mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2024-12-13 18:31:10 +01:00
Fixes issue #71: E-mail parsing can cause issues with emails being
picked up multiple times. patch provided by hudora.de; thank you!
This commit is contained in:
parent
acd082a329
commit
70c9d2d523
@ -95,13 +95,17 @@ def process_queue(q):
|
|||||||
|
|
||||||
server.login(q.email_box_user, q.email_box_pass)
|
server.login(q.email_box_user, q.email_box_pass)
|
||||||
server.select(q.email_box_imap_folder)
|
server.select(q.email_box_imap_folder)
|
||||||
status, data = server.search(None, 'ALL')
|
while True:
|
||||||
for num in data[0].split():
|
status, data = server.search(None, 'NOT', 'DELETED')
|
||||||
status, data = server.fetch(num, '(RFC822)')
|
msgnums = data[0].split()
|
||||||
ticket = ticket_from_message(message=data[0][1], queue=q)
|
if not msgnums:
|
||||||
if ticket:
|
break
|
||||||
server.store(num, '+FLAGS', '\\Deleted')
|
for num in msgnums:
|
||||||
|
status, data = server.fetch(num, '(RFC822)')
|
||||||
|
ticket = ticket_from_message(message=data[0][1], queue=q)
|
||||||
|
if ticket:
|
||||||
|
server.store(num, '+FLAGS', '\\Deleted')
|
||||||
|
|
||||||
server.expunge()
|
server.expunge()
|
||||||
server.close()
|
server.close()
|
||||||
server.logout()
|
server.logout()
|
||||||
|
Loading…
Reference in New Issue
Block a user