Browse Source

replace seen flag when mail correctly added

Guénaël Muller 6 years ago
parent
commit
f5c9c870ff
1 changed files with 2 additions and 0 deletions
  1. 2 0
      tracim/tracim/lib/email_fetcher.py

+ 2 - 0
tracim/tracim/lib/email_fetcher.py View File

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 : {}'