Gmail POP3 not getting all messages in Java application(Gmail POP3 未在 Java 应用程序中获取所有邮件)
问题描述
我已为我的 gmail 启用 POP3 设置.我可以在 Java 应用程序中使用我的密码连接到 POP3 商店.我的收件箱中有大约 10k 条消息.
I have enabled POP3 settings for my gmail. I am able to connect to the POP3 store using my password in a Java app. I have around 10k messages in my inbox.
当我在收件箱文件夹中调用 getMessages
时,它只返回 280 条旧邮件.当我在循环中调用 getMessages
时,每次调用都会返回相同的消息.我也试过 getMessages(start, end)
但它不返回除了 280 条以外的其他消息.
When I call getMessages
on the Inbox folder it returns only 280 old messages. When I call getMessages
in a loop, every call returns me same messages. I also tried getMessages(start, end)
but it does not return other messages than those 280.
如何检索其他消息?
推荐答案
默认情况下,GMail 的 POP3 和 IMAP 服务器的行为不像标准的 POP3 或 IMAP 服务器,并且使用这些协议隐藏来自客户端的消息(以及其他非标准行为).
By default, GMail's POP3 and IMAP server does not behave like standard POP3 or IMAP servers and hides messages from clients using those protocols (as well as having other non-standard behavior).
如果您想配置您的 GMail POP3 或 IMAP 设置,使其按照 POP3 和 IMAP 的预期行为方式按照其协议规范运行,您需要通过网络浏览器登录到您的 GMail 帐户并导航到您的 GMail Settings
页面的 Forwarding and POP/IMAP
选项卡,并将您的选项设置为如下所示:
If you want to configure your GMail POP3 or IMAP settings to behave the way POP3 and IMAP are intended to behave according to their protocol specifications, you'll need to log in to your GMail account via your web browser and navigate to the Forwarding and POP/IMAP
tab of your GMail Settings
page and set your options to look like this:
POP3 下载
[X] 为所有邮件启用 POP(即使是已经下载的邮件)
[X] Enable POP for all mail (even mail that's already been downloaded)
IMAP 访问
[X] 启用 IMAP
[X] Enable IMAP
[X] 自动删除关闭 - 等待客户端更新服务器
[X] Auto-expunge off - wait for the client to update the server
[X]立即永久删除消息
[X] Immediately delete the message forever
这篇关于Gmail POP3 未在 Java 应用程序中获取所有邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Gmail POP3 未在 Java 应用程序中获取所有邮件
基础教程推荐
- 在螺旋中写一个字符串 2022-01-01
- 如何对 HashSet 进行排序? 2022-01-01
- 如何在不安装整个 WTP 包的情况下将 Tomcat 8 添加到 Eclipse Kepler 2022-01-01
- 如何使用 Stream 在集合中拆分奇数和偶数以及两者的总和 2022-01-01
- 如何强制对超级方法进行多态调用? 2022-01-01
- 首次使用 Hadoop,MapReduce Job 不运行 Reduce Phase 2022-01-01
- 如何使用 Eclipse 检查调试符号状态? 2022-01-01
- Spring Boot Freemarker从2.2.0升级失败 2022-01-01
- 由于对所需库 rt.jar 的限制,对类的访问限制? 2022-01-01
- Java 中保存最后 N 个元素的大小受限队列 2022-01-01