Error in the way CFPOP and CFIMAP handles attachments.| View in Tracker
Components: General Server
Found In Build/Fixed In Build: CF11_Final /
Priority/Frequency: Major / All users will encounter
Locale/System: ALL / Win 2012 Server x64
Vote Count: 0
Duplicate ID: CF-4016861 Problem Description: When cfpop or cfimap is used to retrieve mail that was generated by Apple Mail with an inline attachment, an error is thrown. There may be a bug in the way ColdFusion is using the JavaMail APIs to access the content of the mail message. The MIME standard for mail messages allows a very wide range of possibilities but most mail clients only support a small subset of the possibilities. I've seen cases recently where Apple Mail has created messages that conform to the MIME standard but otherwise have an "unusual" structure. JavaMail can handle all the possibilities, but that unusual structure is probably something that ColdFusion is not prepared to deal with. Not all attachments are having problems. For example, if I mail an attachment from my phone, it works just fine. The problem seems to be limited to when an attachment is inserted inline into the email through Apple Mail. It's been pretty easy to reproduce. I simply drag and drop any JPG file into an Apple Mail message and the retrieval from my CF script fails. So far I've tried it with a multitude of different mail applications (Gmail, Thunderbird, Outlook, other web based, etc) and I've replaced the JRE that the CF Server is running on (you know, just in case.) Steps to Reproduce: Using Apple Mail, send an email message containing a JPG image dragged and dropped into the body of the message. Execute the following ColdFusion script to retrieve that email. <cfscript> variables.mailService = new pop(); variables.mailService.setAttributes( Server = '[my mail server]', Username = '[my username]', Password = '[my password]' ); variables.Headers = variables.mailService.getHeaderOnly(); writeDump(variables.Headers); variables.Mail = variables.mailService.getAll(); writeDump(variables.Mail); </cfscript> Actual Result: The cause of this exception was: java.lang.ClassCastException: javax.mail.internet.MimeMessage cannot be cast to javax.mail.internet.MimeBodyPart. Expected Result: Email should be returned as expected. Any Workarounds: None. ----------------------------- Additional Watson Details ----------------------------- Watson Bug ID: 4062553 External Customer Info: External Company: External Customer Name: David Byers External Customer Email: External Test Config: My Hardware and Environment details: ColdFusion 11 with Service Pack 5 running on Windows Server 2012. Also ColdFusion 11 with Service Pack 6 running on Windows Server 2012. Also ColdFusion 11 with Service Pack 6 running on Ubuntu Linux 14.04.
- September 25, 2015 00:00:00: 1_Stack.txt