Unable to send email with large attachments
SummaryUpon sending an attachment of base64 encoded file, the size of the attachment is increasing.
As a result of this attachment are not being sent as the SMTP server is configured to send attachment up to 15 MB.
Error Messages(pega_integrationengine_default) ERROR - Unexpected exception caught while trying to send an email message with sender ID of <ABC> and addressee of <XYZ>:
com.sun.mail.smtp.SMTPSendFailedException: 552 5.2.3 Message exceeds maximum fixed size (23068672)
Steps to Reproduce
1. Create a Case with utility shape to send an email.
2. Utility shape is configured to use SendEmailWithAttachments rule.
3. Run the case and attach a file.
4. Turn on the tracer.
5. Complete send email step, the value of the pyData field is observed to be of size more than the original size of the attachment.
This increase of size in file size is causing the problem as allowed size on SMTP server is 15 MB.
Root CauseA defect or configuration issue in the operating environment.
This is a normal behavior, if base64 encoded stream is given to the server, it encodes it as 4 bytes for every 3 bytes.
ResolutionHere’s the explanation for the reported behavior:
Base64 encoding mechanism have been explained to the user, if base64 encoded stream is given to the server, it encodes it as 4 bytes for every 3 bytes.
Following is the alternate local-change:
1. Limiting the size of the upload.
2. Changing the SMTP server configuration to allow bigger size files.
Published February 13, 2017 - Updated March 3, 2017