Hi,

I'm using Apache Camel and its mail component to read emails and their attachments.

I have encountered a problem which occurs when handling mails with multiple attachments using the same file name.

It seems that the problem is caused by the use of Map<String, DataHandler> type in org.apache.camel.component.mail.MailBinding. Attachments are looped and checked against this map. If the map already contains a key with the same file name, attachment is skipped:

https://github.com/apache/camel/blob/camel-2.10.x/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java#L327

Maybe this key value could be somehow incremented so the map could contain all attachments despite of their file names?

I'm using Camel version 2.10.7 but the code seems to be unchanged by this part in current version too.

This kind of mails are regularly coming from end users of our software and there's no easy way to circumvent this from our side.

Thanks.

Reply via email to