none
Exchange not respecting configured message size limit on messages created by Java app RRS feed

  • Question

  • We have a Java application that emails some of our customers. Occasionally large attachments are included with the email. Our admin as configured our Exchange server to allow for a 20MB attachment, however any message we send over 5MB it rejects saying the message is too large. However, if I log into my email account (either Outlook or web client) and send a message with an attachment over 5MB, it sends fine.

    I have tested our Java app with and without authentication and it gives the same results both times. On our Exchange 2003 server it gives an NDA with the message "This message is too large to send. To be able to send it, make the message smaller, for example, by removing attachments.".  On our Exchange 2010 server it throws back the following exception to our application "com.sun.mail.smtp.SMTPSendFailedException: 552 5.3.4 Message size exceeds fixed maximum message size".


    • Edited by rhaman Thursday, December 22, 2011 3:43 PM
    Thursday, December 22, 2011 3:42 PM

Answers

  • On Thu, 22 Dec 2011 15:42:14 +0000, rhaman wrote:
     
    >
    >
    >We have a Java application that emails some of our customers. Occasionally large attachments are included with the email. Our admin as configured our Exchange server to allow for a 20MB attachment, however any message we send over 5MB it rejects saying the message is too large. However, if I log into my email account (either Outlook or web client) and send a message with an attachment over 5MB, it sends fine.
    >
    >I have tested our Java app with and without authentication and it gives the same results both times. On our Exchange 2003 server it gives an NDA with the message "This message is too large to send. To be able to send it, make the message smaller, for example, by removing attachments.". On our Exchange 2010 server it throws back the following exception to our application "com.sun.mail.smtp.SMTPSendFailedException: 552 5.3.4 Message size exceeds fixed maximum message size".
     
    So the first question to ask is "are you using SMTP or ESMPT?" If you
    start the SMTP session with EHLO you get a list of keywords, one of
    which is "SIZE". If you get that, why does your application try to
    send a message larger than the maximum size advertised by the server?
     
    If you're using HELO to start the conversation then you have no way to
    know whether the message exceeds some limit before you send your
    message -- so why not use ESMTP and move out of the 1990's?
     
    It's easy enough for you to see what the acceptable maximum message
    site is -- just "telnet <IP-address> 25" and enter "EHLO" after you
    receive the 220 banner. If the SIZE value isn't 20*1024*1024 then have
    your admin fix it.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Thursday, December 22, 2011 10:45 PM

All replies

  • On Thu, 22 Dec 2011 15:42:14 +0000, rhaman wrote:
     
    >
    >
    >We have a Java application that emails some of our customers. Occasionally large attachments are included with the email. Our admin as configured our Exchange server to allow for a 20MB attachment, however any message we send over 5MB it rejects saying the message is too large. However, if I log into my email account (either Outlook or web client) and send a message with an attachment over 5MB, it sends fine.
    >
    >I have tested our Java app with and without authentication and it gives the same results both times. On our Exchange 2003 server it gives an NDA with the message "This message is too large to send. To be able to send it, make the message smaller, for example, by removing attachments.". On our Exchange 2010 server it throws back the following exception to our application "com.sun.mail.smtp.SMTPSendFailedException: 552 5.3.4 Message size exceeds fixed maximum message size".
     
    So the first question to ask is "are you using SMTP or ESMPT?" If you
    start the SMTP session with EHLO you get a list of keywords, one of
    which is "SIZE". If you get that, why does your application try to
    send a message larger than the maximum size advertised by the server?
     
    If you're using HELO to start the conversation then you have no way to
    know whether the message exceeds some limit before you send your
    message -- so why not use ESMTP and move out of the 1990's?
     
    It's easy enough for you to see what the acceptable maximum message
    site is -- just "telnet <IP-address> 25" and enter "EHLO" after you
    receive the 220 banner. If the SIZE value isn't 20*1024*1024 then have
    your admin fix it.
     
    ---
    Rich Matheisen
    MCSE+I, Exchange MVP
     

    --- Rich Matheisen MCSE+I, Exchange MVP
    Thursday, December 22, 2011 10:45 PM
  • Hello,

    I'm having the same issue where by sending encryption email using Java Mail hitting the error where by sending out with outlook with the same size attachment with no problem:

    com.sun.mail.smtp.SMTPSendFailedException: 552 #5.3.4 message size exceeds limit

    I didn't set any attribute to start with EHLO and HELO, i'm just starting with mail.smtp.host attribute in the session.

    @Rich Matheisen,

    How do i know whether the session is with EHLP or HELO?

    @Rhaman,

    Do you manage to find the solution for your email size problem?

    Thanks

    Wednesday, August 16, 2017 7:15 AM