tracker issue : CF-4062553

select a category, or use search below
(searches all categories and all time range)
Title:

Error in the way CFPOP and CFIMAP handles attachments.

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/Duplicate

Reporter/Name(from Bugbase): David Byers / David Byers (David Byers)

Created: 09/23/2015

Components: General Server

Versions: 11.0

Failure Type:

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.

Attachments:

  1. September 25, 2015 00:00:00: 1_Stack.txt

Comments:

This is a duplicate bug of #CF-4016861
Comment by HariKrishna K.
5759 | September 25, 2015 05:55:14 AM GMT
Hi, I can see some exception you are getting. Please provide the stacktrace as well which will help us in identifying the root cause. Thanks, Pavan,
Comment by S V.
5760 | September 25, 2015 08:14:25 AM GMT
Added as an attachment since it's over 4000 characters.
Comment by External U.
5761 | September 25, 2015 09:48:46 AM GMT