Forums Register Login

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

+Pie Number of slices to send: Send
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);
+Pie Number of slices to send: Send
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.
This guy is skipping without a rope. At least, that's what this tiny ad said:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1000 times.
Similar Threads
Read both header and body in one call using java
How to properly read the custom Header value in the E-mail envolope
connecting to gmail pop3 server
Send email using IMAP , what changes my code need to do authentication ?
java.lang.NoSuchMethodError: com.sun.mail.pop3.POP3Store.<init>
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 06:46:59.