Gmail POP3 not getting all messages in Java application

我的梦境 提交于 2019-12-01 04:36:41

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/31964593/gmail-pop3-not-getting-all-messages-in-java-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!