Xorty
Xorty

Reputation: 18861

Java: JavaMail, POP3 and few problems

I'd like to ask few questions about handling POP3 protocol with JavaMail (I'm building small web mail client):

  1. How do I know which mail is new? Mail server doesn't provide this info explicitely. I have to iterate thru all mails and check with my database, which are new
  2. What if someone sends a really big attachment? Is there way how not to download it and limit it to certain size? Like with MimePart?

Upvotes: 1

Views: 834

Answers (1)

dkarp
dkarp

Reputation: 14763

  1. POP offers only two reliable ways to keep track of which messages you've already downloaded. First is to delete them after downloading, which you evidently don't want to do. And second is to track UIDLs in your local database.

  2. There is no way to download a subset of message parts via POP, as POP doesn't include a message structure model. You can fetch the first N lines from a message if the POP server supports the TOP command, but that probably isn't what you want.

It sounds like you want IMAP, not POP.

Upvotes: 1

Related Questions