diff --git a/Mailnag/backends/imap.py b/Mailnag/backends/imap.py index 91ecd66..f6e74dd 100644 --- a/Mailnag/backends/imap.py +++ b/Mailnag/backends/imap.py @@ -148,7 +148,7 @@ def mark_as_seen(self, mails): if folder != last_folder: conn.select(f'"{folder}"', readonly = False) last_folder = folder - status, data = conn.uid("STORE", m.flags['uid'], "+FLAGS", "(\Seen)") + status, data = conn.uid("STORE", m.flags['uid'], "+FLAGS", r"(\Seen)") except: logging.warning("Failed to set mail with uid %s to seen on server (account: '%s').", m.flags['uid'], acc.name) diff --git a/Mailnag/common/imaplib2.py b/Mailnag/common/imaplib2.py index e97ccab..70fa8d3 100644 --- a/Mailnag/common/imaplib2.py +++ b/Mailnag/common/imaplib2.py @@ -2466,7 +2466,7 @@ def ParseFlags(resp): ('select', ('imaplib2_test2',)), ('search', (None, 'SUBJECT', '"IMAP4 test"')), ('fetch', ('1:*', '(FLAGS INTERNALDATE RFC822)')), - ('store', ('1', 'FLAGS', '(\Deleted)')), + ('store', ('1', 'FLAGS', r'(\Deleted)')), ('namespace', ()), ('expunge', ()), ('recent', ()), @@ -2571,7 +2571,7 @@ def run(cmd, args, cb=True): if not uid: continue run('uid', ('FETCH', uid[-1], '(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)')) - run('uid', ('STORE', uid[-1], 'FLAGS', '(\Deleted)')) + run('uid', ('STORE', uid[-1], 'FLAGS', r'(\Deleted)')) run('expunge', ()) if 'IDLE' in M.capabilities: @@ -2585,10 +2585,10 @@ def run(cmd, args, cb=True): dat = run('fetch', (num, '(FLAGS INTERNALDATE RFC822)'), cb=False) M._mesg('fetch %s => %s' % (num, repr(dat))) run('idle', (2,)) - run('store', (num, '-FLAGS', '(\Seen)'), cb=False), + run('store', (num, '-FLAGS', r'(\Seen)'), cb=False), dat = run('fetch', (num, '(FLAGS INTERNALDATE RFC822)'), cb=False) M._mesg('fetch %s => %s' % (num, repr(dat))) - run('uid', ('STORE', num, 'FLAGS', '(\Deleted)')) + run('uid', ('STORE', num, 'FLAGS', r'(\Deleted)')) run('expunge', ()) if idle_intr: M._mesg('HIT CTRL-C to interrupt IDLE')