Gmail POP3没有在Java应用程序中获取所有消息 [英] Gmail POP3 not getting all messages in Java application

查看:117
本文介绍了Gmail POP3没有在Java应用程序中获取所有消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为我的Gmail启用了POP3设置。我可以使用我的密码在Java应用程序中连接到POP3商店。我的收件箱中有大约10k个邮件。



当收件箱文件夹中调用 getMessages 时,它只返回280个旧消息。当我在循环中调用 getMessages 时,每个调用都返回相同的消息。我也尝试过 getMessages(开始,结束),但不返回其他消息,而不是280.



我检索其他消息?

解决方案

默认情况下,GMail的POP3和IMAP服务器的行为不像标准的POP3或IMAP服务器和隐藏来自使用这些协议的客户端的消息(以及具有其他非标准行为)。



如果要配置您的GMail POP3或IMAP设置,以使POP3和IMAP旨在根据协议规范进行操作,您需要通过Web浏览器登录到您的GMail帐户,并导航到转发和POP / IMAP 标签您的GMail 设置页面,并设置您的选项如下所示:



POP3下载



[X]启用POP 所有邮件(即使已经下载的邮件)



IMAP访问



[X]启用IMAP



[X]自动关闭 - 等待客户端更新服务器

[X]永远删除邮件


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.

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.

How do I retrieve the other messages?

解决方案

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).

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 Download

[X] Enable POP for all mail (even mail that's already been downloaded)

IMAP Access

[X] Enable IMAP

[X] Auto-expunge off - wait for the client to update the server

[X] Immediately delete the message forever

这篇关于Gmail POP3没有在Java应用程序中获取所有消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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