Incorrect use of Message#getSize() in MailUtils
-----------------------------------------------

                 Key: SYNAPSE-359
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-359
             Project: Synapse
          Issue Type: Bug
          Components: Transports
    Affects Versions: 1.2
            Reporter: Andreas Veithen
            Assignee: Andreas Veithen
             Fix For: 1.3


The Javadoc of the Message#getSize() method specifies that "the size may not be 
an exact measure of the content size and may or may not account for any 
transfer encoding  of the content. The size is appropriate for display in a 
user interface to give the user a rough idea of the size of this part." However 
MailUtils#getMessageTextPayload and MailUtils#getMessageBinaryPayload in 
conjunction with MailUtils#getBytesFromInputStream use this information to 
allocate a buffer and subsequently compare it with the number of bytes actually 
read from the message. When the estimation returned by getSize is not accurate, 
this leads to a failure with error message "Could not completely read the 
stream to conver to a byte[]". Therefore the mail transport listener is in 
general unable to process plain text or binary messages correctly.

Note that the code causing this issue will be replaced by the modifications 
proposed in SYNAPSE-304.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to