aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVG <vg@devys.org>2016-05-12 17:48:18 +0200
committerVG <vg@devys.org>2016-05-12 17:48:18 +0200
commit2829d593fbe44195d896424bc1a40dc64cf524f0 (patch)
tree338d63420ed5303b13f93e5ca787203b184a6f91
parent94ce286d1fd5ae92aabe98b3f6f27d5426c703c9 (diff)
downloadcliml-2829d593fbe44195d896424bc1a40dc64cf524f0.tar.gz
climl-2829d593fbe44195d896424bc1a40dc64cf524f0.tar.bz2
climl-2829d593fbe44195d896424bc1a40dc64cf524f0.zip
Fix mail id by search after idle
-rw-r--r--climl/imap.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/climl/imap.py b/climl/imap.py
index 4616e01..14ecf2f 100644
--- a/climl/imap.py
+++ b/climl/imap.py
@@ -140,12 +140,11 @@ def main(callback=None):
print('calling callback...')
callback('mail: ' + str(oneid))
while True:
- events = imap_waiter(connection)
- if events:
- print('events:', events)
- for oneid, _ in events:
- print('calling callback...')
- callback('mail: ' + str(oneid))
+ imap_waiter(connection)
+ idlist = connection.search(['UNSEEN'])
+ for oneid in idlist:
+ print('calling callback...')
+ callback('mail: ' + str(oneid))
except (socket.error, socket.timeout):
pass
except KeyboardInterrupt: