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