Zend Imap 连接超时
我正在使用 Zend 框架提供的 IMAP 类通过 imap 访问 gmail 消息。我一一访问收件箱中所有邮件的邮件标题并在本地索引它们。对于消息少于 10000 条的收件箱,该脚本运行良好。对于较大的收件箱,脚本会断开连接,可能会超时。
这是堆栈跟踪:
异常消息:无法读取 - 连接已关闭?
跟踪:
#0 /home/dev/trunk/Zend/Mail/Protocol/Imap.php(168): Zend_Mail_Protocol_Imap->_nextLine()
#1 /home/dev/trunk/Zend/Mail/Protocol/Imap.php(285): Zend_Mail_Protocol_Imap->_nextTaggedLine(NULL)
#2 /home/dev/trunk/Zend/Mail/Protocol/Imap.php(587): Zend_Mail_Protocol_Imap->readLine(NULL, 'TAG103')
#3 /home/dev/trunk/Zend/Mail/Storage/Imap.php(353): Zend_Mail_Protocol_Imap->fetch('UID', 12267)
#4 /home/dev/trunk/model/gmail_imap_oauth.class.php(121): Zend_Mail_Storage_Imap->getUniqueId(12267)
有没有可能的方法来保持连接更长时间?我通过命令行运行此脚本并尝试增加 php.ini 中的脚本最大运行时间,但没有帮助。
I'm using Zend framework provided IMAP classes to access gmail messages over imap. I access the message headers of all the messages in the inbox one by one and index them locally. The script works fine for inboxes with messages less than 10000. For larger inboxes the script looses the connection, probably a timeout.
Here is the stack trace:
Exception Message: cannot read - connection closed?
trace:
#0 /home/dev/trunk/Zend/Mail/Protocol/Imap.php(168): Zend_Mail_Protocol_Imap->_nextLine()
#1 /home/dev/trunk/Zend/Mail/Protocol/Imap.php(285): Zend_Mail_Protocol_Imap->_nextTaggedLine(NULL)
#2 /home/dev/trunk/Zend/Mail/Protocol/Imap.php(587): Zend_Mail_Protocol_Imap->readLine(NULL, 'TAG103')
#3 /home/dev/trunk/Zend/Mail/Storage/Imap.php(353): Zend_Mail_Protocol_Imap->fetch('UID', 12267)
#4 /home/dev/trunk/model/gmail_imap_oauth.class.php(121): Zend_Mail_Storage_Imap->getUniqueId(12267)
Is there a possible way to keep the connection alive for a longer duration ? I'm running this script via command line and tried increasing the script max runtime in php.ini, it didn't help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里的函数
public function indexAllMails($startIndex=1)
{
}
Here the function
public function indexAllMails($startIndex=1)
{
}