title: How to get unseen emails using python imap-tools
body: <pre><code>from imap_tools import MailBox, AND
  import re
  
  yahooSmtpServer = &quot;imap.mail.yahoo.com&quot;
  
  client = MailBox(yahooSmtpServer).login('myEmail', 'myPassword', 'INBOX')
  for msg in client.fetch(AND(seen=False)):
      mail = msg.html
      print(mail)
              
  </code></pre>
  <p>I want t get unseen messages in my mail as soon as they'll appear in my inbox. looping through this code I can always check for unseen messages but it's really troublesome and I don't know how to flag a message as read.</p>
  <p>so is there any way I can get unseen messages in my yahoo mail inbox using IMAP-tools? if not... can I do it using another library?
  Thank you.</p>