james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject Re: Facing problems in email parsing using mime4j
Date Mon, 01 Aug 2011 07:53:53 GMT
Can you provide a test case or sample code showing the issue?

Stefano

2011/8/1 Sharma, Ashish <ashish.sharma3@hp.com>:
> Stefano,
>
> I am using mime4j 0.6.1, Right now I am using the 'StorageProvider' interface to consume
the whole inputstream via the ContentHandler event api of mime4j.
>
> Please reply your comments on this.
>
> Thanks
> Ashish
>
> -----Original Message-----
> From: Stefano Bagnara [mailto:apache@bago.org]
> Sent: Tuesday, July 26, 2011 8:24 PM
> To: mime4j-dev@james.apache.org
> Subject: Re: Facing problems in email parsing using mime4j
>
> 2011/7/26 Sharma, Ashish <ashish.sharma3@hp.com>:
>> Hi,
>>
>> I am using mime4j for parsing an incoming mail stream and pulling out email body
(html and plain text) and attachments.
>
> What version of mime4j?
>
>> Basically I am creating an 'Email' class that contains 'EmailAttachment' object references.
>>
>> The 'EmailAttachment' consists of a 'BodyDescriptor' and an 'InputStream', that are
populated by listening to the events generated by a 'ContentHandler'.
>
> You have to make sure you consume the whole inputstream before moving
> to the next event, otherwise mime4j will consume it for you in order
> to produce the next event.
>
> If you want to parse the full message and access it from memory then
> you should better use the dom classes that already provides you with a
> message and ignore the low level content handler.
>
> Stefano
>
>> Now the problem that I am facing is that as soon as parsing is over and I pull out
'EmailAttachment' objects for further processing , the InputStream object does not have the
full decoded data of the original attachment, only a small amount of the original attachment
is there.
>>
>> I am unable to understand where is the data going?
>>
>> Do I need to use some kind of in memory storage provider?
>>
>> Thanks
>> Ashish Sharma
>>
>

Mime
View raw message