camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vitalii (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-6045) Camel Email Component Missing Attachments
Date Tue, 24 Sep 2013 17:42:13 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-6045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13776539#comment-13776539
] 

Vitalii commented on CAMEL-6045:
--------------------------------

The problem is not with disposition, but with fileName. I had a case when disposition was
not null, but the fileName == null. (mail from Microsoft Exchange Server btw). The fileName
should not be null in any case. Or the map entry (null -> part) will be added, which is
not good and causes NPEs.
                
> Camel Email Component Missing Attachments 
> ------------------------------------------
>
>                 Key: CAMEL-6045
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6045
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mail
>    Affects Versions: 2.6.0
>            Reporter: Christoph Giera
>            Assignee: Claus Ibsen
>             Fix For: 2.9.6, 2.10.4, 2.11.0
>
>         Attachments: MailBinding.java.patch
>
>
> see http://camel.465427.n5.nabble.com/Camel-Email-Component-Missing-Attachments-td3386382.html#a5727102
> The disposition field is optional(see RFC 2183), so it is possible that camel misses
attachments.
> {noformat}
>                 if (disposition != null && (disposition.equalsIgnoreCase(Part.ATTACHMENT)
|| disposition.equalsIgnoreCase(Part.INLINE))) {
>                     // only add named attachments
>                     String fileName = part.getFileName();
>                     if (fileName != null) {
>                         LOG.debug("Mail contains file attachment: " + fileName);
>                         // Parts marked with a disposition of Part.ATTACHMENT are clearly
attachments
>                         CollectionHelper.appendValue(map, fileName, part.getDataHandler());
>                     }
>                 }
> {noformat}
> Adding the fileName check to the if should resolve the issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message