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 应用程序中获取所有邮件


- 如何指定 CORS 的响应标头? 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01
- 转换 ldap 日期 2022-01-01
- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01
- 未找到/usr/local/lib 中的库 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01
- 获取数字的最后一位 2022-01-01
- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01