You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Eric Charles <er...@apache.org> on 2011/01/19 08:51:45 UTC

org.apache.mailet.Mail to InputStream

Hi,

For the 2.3 import tool, I need to convert the org.apache.mailet.Mail to 
InputStream (not only the MimeMessage, but the whole mail with subject, 
headers,...).
Is there an existing utility class, or should I write one (one where to 
place it ?) ?

Tks,

Eric


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: org.apache.mailet.Mail to InputStream

Posted by Eric Charles <er...@apache.org>.
Hi Norman,

I used the mail.getMessage().toInputStream() which returned only the 
body (not the headers).
So I will use the MimeMessageInputStream(mail.getMessage()).
Tks,

Eric


On 19/01/2011 09:01, Norman Maurer wrote:
> Hi Eric,
>
> I'm a bit confused.. The MimeMessage contains everything you need. I
> think this should do the job:
>
> new MimeMessageInputStream(mail.getMessage);
>
> Bye,
> Norman
>
>
> 2011/1/19 Eric Charles<er...@apache.org>:
>> Hi,
>>
>> For the 2.3 import tool, I need to convert the org.apache.mailet.Mail to
>> InputStream (not only the MimeMessage, but the whole mail with subject,
>> headers,...).
>> Is there an existing utility class, or should I write one (one where to
>> place it ?) ?
>>
>> Tks,
>>
>> Eric
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-dev-help@james.apache.org
>>
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: org.apache.mailet.Mail to InputStream

Posted by Norman Maurer <no...@apache.org>.
Hi Eric,

I'm a bit confused.. The MimeMessage contains everything you need. I
think this should do the job:

new MimeMessageInputStream(mail.getMessage);

Bye,
Norman


2011/1/19 Eric Charles <er...@apache.org>:
> Hi,
>
> For the 2.3 import tool, I need to convert the org.apache.mailet.Mail to
> InputStream (not only the MimeMessage, but the whole mail with subject,
> headers,...).
> Is there an existing utility class, or should I write one (one where to
> place it ?) ?
>
> Tks,
>
> Eric
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org