I have read through all PHP documentation on IMAP functions (www.php.net/imap), but didn't find anything on issueing an IDLE command over an IMAP connection.
我已閱讀有關IMAP函數(www.php.net/imap)的所有PHP文檔,但未發現有關通過IMAP連接發出IDLE命令的任何內容。
I want to establish an IMAP connection between my server and GMail, and be notified instantly that a new message has arrived. It's kind of GMail PUSH to my server. The way mobile devices are doing it is by connecting through IMAP and sending the IDLE command.
我想在我的服務器和GMail之間建立IMAP連接,並立即通知新消息已到達。這是我服務器的GMail PUSH。移動設備的方式是通過IMAP連接並發送IDLE命令。
But didn't find a word on IDLE in PHP-IMAP. Is it supported?
但是在PHP-IMAP中沒有找到關於IDLE的詞。是否支持?
2 个解决方案
#1
I've been working on modifying the ilohamail.org imap client to support the IDLE extension. My application however will be running with php cli and not through a web server. I can post the code when / if I have a working version.
我一直在努力修改ilohamail.org imap客戶端以支持IDLE擴展。然而,我的應用程序將使用php cli而不是通過Web服務器運行。如果我有工作版本,我可以發布代碼。
You may want to use the http://roundcube.net imap library which is just modified from the ilohamail library.
您可能想要使用剛剛從ilohamail庫修改的http://roundcube.net imap庫。
#2
IDLE isn't supported by PHP's IMAP functions.
PHP的IMAP功能不支持IDLE。
The documentation suggests using imap_ping for a periodic "new mail check"
文檔建議使用imap_ping進行定期“新郵件檢查”