When getting mail with a large attachment JavaMail tries to download the attachment when getCount() is called on the multipart. Is there a way to avoid downloading the attachment if it isn't needed?

Serge Knystautas

The MIME specification does not include meta data on the number of sections or any information on each section, so the only way to know the number of sections in a message is to download the whole message and count each part.

FAQ Manager Note: If you'd like to avoid downloading the attachments altogether, you can use a FetchProfile.