Reputation: 5
we are using Apache Camel Email channel to read emails from mailbox, where participants send emails with XML attachment. We received one email which was not proceed because once Camel tried to read attachment it got attachment attached as com.sun.mail.util.BASE64DecoderStream and we have no decoder for it. I would like to reproduce this issue using Java Mail API but I am not able to sent such a email. The attachment in the email is attached like this:
_002_148827254056800396s1npspdssma1pdnpslocal_
Content-Type: application/octet-stream;
name="20170301_ATC_STATNETT_to_CASC.xml"
Content-Description: 20170301_ATC_STATNETT_to_CASC.xml
Content-Disposition: attachment;
filename="20170301_ATC_STATNETT_to_CASC.xml"; size=3709;
creation-date="Tue, 28 Feb 2017 09:02:22 GMT";
modification-date="Tue, 28 Feb 2017 09:02:22 GMT"
Content-ID: <[email protected]>
Content-Transfer-Encoding: base64
PD94bWwgdmVyc2lvbj0Ii8+PERvY3VtZW50VmVyc2lvbiB2PSIxIi8+PERv
Y3VtZW50VHlwZSB2PSJBMTMiLz48UHJvY2Vzc1R5cGUgdj0iQTA3Ii8+PFNlbmRlcklkZW50aWZp
Y2F0aW9uIHY9IjEwWDEwMDFBMTAwMUEzOFkiIGNvZGluZ1NjaGVtZT0iQTAxIi8+PFNlbmRlclJv
dD4NCg==
--_002_148827254056800396s1npspdssma1pdnpslocal_--
but I was not able to compose such a email with attachment which would be recognised as com.sun.mail.util.BASE64DecoderStream during processing by Camel.
Could you advice to me please? Thanks.
Upvotes: 0
Views: 882
Reputation: 29961
When you get a message with BASE64DecoderStream, you don't need to decode it. That stream is what JavaMail uses to decode the encoded message part. All you need to do is read the stream to get the decoded data.
Upvotes: 2