Having a problem with JavaMail not sending anything when the message is large
posted 1 year ago
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.
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.