diff options
author | VG <vg@devys.org> | 2016-05-09 17:54:27 +0200 |
---|---|---|
committer | VG <vg@devys.org> | 2016-05-09 17:54:27 +0200 |
commit | 6aacf3a4abf6c104f32e6a1dcaf3d3c67cc3aace (patch) | |
tree | bae8e19f39c5d6cc165cf41758e2dd20533a9735 | |
parent | 2512ade6b4d0560972e09cf667885816f5ebab9d (diff) | |
download | climl-6aacf3a4abf6c104f32e6a1dcaf3d3c67cc3aace.tar.gz climl-6aacf3a4abf6c104f32e6a1dcaf3d3c67cc3aace.tar.bz2 climl-6aacf3a4abf6c104f32e6a1dcaf3d3c67cc3aace.zip |
Auto-commit on 6d1dbe8495b5fafbc5f50d80268d0ca5b7b097be
-rw-r--r-- | climl/imap.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/climl/imap.py b/climl/imap.py index 783b228..c097a15 100644 --- a/climl/imap.py +++ b/climl/imap.py @@ -103,7 +103,7 @@ def imap_waiter(connection): raise print('quitting idle mode...') connection.idle_done() - return [i for i in events if str(bytes(i[0]), encoding='ascii') != 'OK'] + return [i for i in events if i[1] == b'RECENT'), encoding='ascii') != 'OK'] def main(callback=None): @@ -122,6 +122,8 @@ def main(callback=None): with connect_to_imap(conf, password) as connection: print('selecting folder', conf.get('imap.mailbox')) connection.select_folder(conf.get('imap.mailbox')) + # at start, select all mails + idlist = connection.search(['SEEN']) while True: events = imap_waiter(connection) if events: |