File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes Having a problem with JavaMail not sending anything when the message is large Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Having a problem with JavaMail not sending anything when the message is large" Watch "Having a problem with JavaMail not sending anything when the message is large" New topic
Author

Having a problem with JavaMail not sending anything when the message is large

Rob Tanner
Greenhorn

Joined: Apr 10, 2009
Posts: 19
I'm using SubEtha SMTP in conjunction with JavaMail in order to selectively route mail based on the sender's address (actually I do an LDAP look up and select based on certain criteria in the sender's LDAP entry). The LDAP look-up and the selective routing based on specific criteria within their LDAP entry all works perfectly. I'm seeing a problem occur the message get's too large. I haven't worked it down to the exact number of characters, but I know that a message size of 32217 characters fails. The messages I've tried just picking randomly of my inbox, are a mixture of text, images, and other miscellaneous mime compositions, so I don't think it has to do with specific content, only size. I didn't know there was a size limitation or is it likely something else is the problem but it shows up on the several large files I have?

And one other detail. JavaMail fails quietly. No errors reported and no exceptions thrown.

Any help here would be most appreciated.

Rob Tanner
Linfield College


Rob Tanner
Linfield College
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18886
    
    8

It has to be something to do with the server you're connecting to, since clearly JavaMail works fine with large messages in other contexts. Have you tried running JavaMail in debug mode to see what's happening? It's possible that your server stops receiving after a particular threshold is reached and returns an "accept" type code rather than a "fail" type code. You should be able to see that sort of thing from JavaMail debug output.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Having a problem with JavaMail not sending anything when the message is large