|
|
|
|
27
|
CONTENT_TYPE_TEXT_HTML = 'text/html'
|
27
|
CONTENT_TYPE_TEXT_HTML = 'text/html'
|
28
|
|
28
|
|
29
|
IMAP_CHECKED_FLAG = imapclient.FLAGGED
|
29
|
IMAP_CHECKED_FLAG = imapclient.FLAGGED
|
|
|
30
|
+IMAP_SEEN_FLAG = imapclient.SEEN
|
30
|
|
31
|
|
31
|
MAIL_FETCHER_FILELOCK_TIMEOUT = 10
|
32
|
MAIL_FETCHER_FILELOCK_TIMEOUT = 10
|
32
|
MAIL_FETCHER_CONNECTION_TIMEOUT = 60*3
|
33
|
MAIL_FETCHER_CONNECTION_TIMEOUT = 60*3
|
|
|
|
|
441
|
# Flag all correctly checked mail
|
442
|
# Flag all correctly checked mail
|
442
|
if r.status_code in [200, 204, 400]:
|
443
|
if r.status_code in [200, 204, 400]:
|
443
|
imapc.add_flags((mail.uid,), IMAP_CHECKED_FLAG)
|
444
|
imapc.add_flags((mail.uid,), IMAP_CHECKED_FLAG)
|
|
|
445
|
+ imapc.add_flags((mail.uid,), IMAP_SEEN_FLAG)
|
444
|
# TODO - G.M - Verify exception correctly works
|
446
|
# TODO - G.M - Verify exception correctly works
|
445
|
except requests.exceptions.Timeout as e:
|
447
|
except requests.exceptions.Timeout as e:
|
446
|
log = 'Timeout error to transmit fetched mail to tracim : {}'
|
448
|
log = 'Timeout error to transmit fetched mail to tracim : {}'
|