How do I enable push-notification for IMAP (Gmail) using Python imaplib? How do I enable push-notification for IMAP (Gmail) using Python imaplib? python python

How do I enable push-notification for IMAP (Gmail) using Python imaplib?


There isn't something in imaplib that does this, AFAIK (disclamer: I know very little about Python), however, it seems that someone has implemented an IDLE extension for Python which has the same interface as imaplib (which you can swap out with no changes to existing code, apparently):

https://github.com/imaplib2/imaplib2


Check out ProcImap. It's a more abstract framework on top of libimap and libimap2, providing a nice solution to handle IMAP services. Looks like just the stuff you are looking for, and for me as well. I'm right having the same problem with you and just found ProcImap. Gonna try it for myself.


This link shows an example of using IMAP IDLE: http://blog.timstoop.nl/2009/03/11/python-imap-idle-with-imaplib2/

It uses the same library linked to in casperOne's answer (imaplib2).