Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion imapnotify/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ async def _select_box(self, box='INBOX'):
self.boxes[box]['idle'] = asyncio.ensure_future(imap_client.idle())

def _is_new_msg(self, msg):
return 'EXISTS' in msg
if 'EXISTS' in msg:
return True

# if msg is list of messages
for x in msg:
if 'EXISTS' in x:
return True

async def _on_new_message(self, box):
command = self.boxes[box]['on_new_message']
Expand Down