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

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

{code} if ((disposition != null && 
(disposition.equalsIgnoreCase(Part.ATTACHMENT) || 
disposition.equalsIgnoreCase(Part.INLINE)))
                        || fileName != null)
{code}
There is a problem with the filename check:
If filename==null, it will be added to the map. There should be "&& filename != 
null".
Please correct in future versions.  
 
                
> 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

Reply via email to