如何使用Python imaplib为IMAP(Gmail)启用推送通知? [英] How do I enable push-notification for IMAP (Gmail) using Python imaplib?

查看:148
本文介绍了如何使用Python imaplib为IMAP(Gmail)启用推送通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在每次我想查看是否有新邮件时使用imaplib监控一个gmail帐户而不轮询gmail。换句话说,我只是希望脚本得到一条新消息的通知,这样我就可以马上处理它,而不是在民意测验之间任何滞后时间。

Is there a way to monitor a gmail account using imaplib without polling gmail each time I want to see if there is new mail. Or in other words, I just want the script to be notified of a new message so I can process it right away instead of any lag time between polls.

我看到IMAP协议支持IDLE命令,但是我在imaplib文档中看不到任何记录,因此任何帮助都会很棒!

I see that the IMAP protocol supports this with the IDLE command, but I can't see anything documented with it in the imaplib docs, so any help with this would be great!

推荐答案

http://www.cs.usyd.edu.au/~piers/python/imaplib.html

这篇关于如何使用Python imaplib为IMAP(Gmail)启用推送通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆