Bug? POP library can't download multiple (4meg each) attachments

goldmagnet

Member
Licensed User
Longtime User
Hi

The standard POP library has a problem where emails can not be downloaded if they have multiple attachments (two 4 meg photos for example).

We have tested on different devices, and confirmed there are no out of memory errors, download just never completes.

I believe the issue could be the Jetty cache size and the timeout values but I do not now if these are exposed in any way.

We purchased this product for a particular application requirement, but this behavior is a showstopper so its back to Java until this is fixed which is a shame as the application is fully coded and we hoped to launch this to our users next month.

Huw
www.icode.co.uk/icatcher
 
Last edited:

warwound

Expert
Licensed User
Longtime User
Maybe you could update the existing POP library so that it works as expected.

I've updated the FTP and SMTP libraries - search the forum for NetExtras library.
Maybe a 'simple' update to the POP libray is all that's required?

Martin,
 

BobsYourUncle

Member
Licensed User
Longtime User
Hi Erel,
There's definitely something not right with the POP3 library when downloading larger attachments.
B4X:
  POP.DownloadMessage(Messages.GetKeyAt(i), False)
With a 10MB attachment, after issuing this above command the POP_DownloadCompleted event never fires (with a success or fail). Smaller attachments are fine.
There's nothing obvious in the unfiltered logs.

Help!
 

BobsYourUncle

Member
Licensed User
Longtime User
Just remembered! Isn't there a 16MB RAM limit per Android App? This would make sense as to why a 10MB attachment is failing. (Maybe 6MB ish of other stuff within the App itself.

Is there a way to download the attachments to a file instead of memory?
 

BobsYourUncle

Member
Licensed User
Longtime User
Does this mean anything....
JavaMail 1.4.4 and later can cache POP3 messages in a tmp file on disk, thus using less memory. See the javadocs for the com.sun.mail.pop3 package for the properties to set. You'll still need to be careful how you process the contents of the mail, e.g., using getInputStream instead of getContent to process large attachments.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
It fails somewhere inside the Apache Net library. As I wrote above you should use a different method for such large files. Also remember that mail attachments are about 33% larger than the actual file as they are encoded with Base64. The whole huge string then needs to be decoded.

This is not a good protocol for large files. FTP or Http can handle files of any size.
 
Top