Title:
error "javax.mail.MessagingException: Unable to load BODYSTRUCTURE" when using CFIMAP
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Phil Cruz / Phil Cruz (Phil Cruz)
Created: 10/11/2012
Components: Net Protocols
Versions: 10.0
Failure Type: Non Functioning
Found In Build/Fixed In Build: Final / CF10_Update14
Priority/Frequency: Critical / All users will encounter
Locale/System: English / Win 2008 Server R2 64 bit
Vote Count: 3
Problem Description:
cfimap has an error trying to parse messages that have .eml messages attached in the body. Specifically, if the message is encoded such as
--0016e6dab04d85220f04cbca474e
Content-Type: message/rfc822; charset=UTF-8
Content-Disposition: attachment
Content-Transfer-Encoding: base64
X-Attachment-Id: 777fe6a5abfcc3e5_0.2
This issue is discussed here as well:
http://www.oracle.com/technetwork/java/javamail/faq/index.html#imapserverbug
http://www.theserverside.com/discussions/thread.tss?thread_id=14042
Steps to Reproduce:
1. Create a message with an .eml attached such that it is encoded like above.
2. use this code to access the message
iMapObj = new imap();
iMapObj.setAttributes(server="imap.gmail.com",username=supportEmail, password=popMailPassword,secure="yes", connection="imapConnection");
iMapObj.open();
qryMailHeaders = iMapObj.getHeaderOnly(connection = "imapConnection");
iMapObj.close(connection="imapConnection");
Actual Result:
you get an error
Message: Unable to load BODYSTRUCTURE
StackTrace: javax.mail.MessagingException: Unable to load BODYSTRUCTURE
at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1297)
at com.sun.mail.imap.IMAPMessage.getLineCount(IMAPMessage.java:407)
at coldfusion.mail.EmailTable.populate(EmailTable.java:138)
at coldfusion.mail.IMapImpl.getMails(IMapImpl.java:329)
at coldfusion.tagext.net.IMapTag$1.run(IMapTag.java:541)
at java.security.AccessController.doPrivileged(Native Method)
at coldfusion.tagext.net.IMapTag.doStartTag(IMapTag.java:537)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799)
at cfbase2ecfc450754003$funcINVOKETAG.runFunction(C:\ColdFusion10\cfusion\CustomTags\com\adobe\coldfusion\base.cfc:566)
Expected Result:
No error.
Any Workarounds:
None.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3345011
External Customer Info:
External Company:
External Customer Name: Phil.Cruz
External Customer Email:
External Test Config: Windows 7/64bit and Windows Server 2008 R2/64bit
Attachments:
- July 14, 2014 00:00:00: 1_Bug-3345011.pdf
Comments: