• Post Reply Bookmark Topic Watch Topic
  • New Topic

POP3 at hotmail inbox fetch large number of read mail never return

 
Mark Qian
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to read from a hotmail accond using pop3s. The fetch method never return if I have many (like 600+) read mail in my inbox (only couple of unread mails). It seem that it tried to fetch all of them. I am only interested in unread ones but it seems that Flag.SEEN did not really work...
Any suggestion?

Here is my code:

Properties props = System.getProperties();
props.setProperty("mail.pop3s.port", "995");
session = Session.getInstance(props, null);
store = session.getStore("pop3s");
store.connect(server, 995, user, pw);
inbox = store.getFolder("Inbox");
inbox.open(Folder.READ_WRITE);
Message messages[] = inbox.search(new FlagTerm(
new Flags(Flag.SEEN), false));
FetchProfile fp = new FetchProfile();
fp.add(FetchProfile.Item.ENVELOPE);
fp.add(FetchProfile.Item.CONTENT_INFO);
inbox.fetch(messages, fp);
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is some method you can call to check what flags a Store supports - if memory serves, POP3 supports just a single flag, and it's not SEEN.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!