Sorry,
I make amendments. I did the test using the mime4j java app using Swing GUI.
But just now I used my mailet:
public void mime4jService(Mail mail) throws MessagingException {
MimeMessageWrapper mimeMessageWrapper = (MimeMessageWrapper)
mail.getMessage();
try {
InputStream is = mimeMessageWrapper.source.getInputStream();
org.mime4j.message.Message message = new
org.mime4j.message.Message(is);
} catch (IOException ioe) {
System.out.println(ioe);
ioe.printStackTrace();
}
}
public void service(Mail mail) throws MessagingException {
boolean bUseMime4j = true;
mime4jService(mail);
if (bUseMime4j) return;
.....
}
And for the same 30+ MB message.
It is about 8 seconds. (I tried several times and it is the same about 8
seconds and uses without extra memory, default java).
and for 190+ MB file, it takes 1 minute 32 seconds.
I cannot think how it is different.
And the FileStreamStore and FileObjectStore goes to error folder when I use
the above codes. Do I need to set the
mail.setState(Mail.TRANSPORT);
like:
public void mime4jService(Mail mail) throws MessagingException {
MimeMessageWrapper mimeMessageWrapper = (MimeMessageWrapper)
mail.getMessage();
try {
InputStream is = mimeMessageWrapper.source.getInputStream();
org.mime4j.message.Message message = new
org.mime4j.message.Message(is);
mail.setState(Mail.TRANSPORT);
} catch (IOException ioe) {
System.out.println(ioe);
ioe.printStackTrace();
}
}
Regards,
Edward
On 12/31/05, Stefano Bagnara <[EMAIL PROTECTED]> wrote:
>
> Edward Tan wrote:
> > I have tried mime4j just now and I compared it with James that uses
> Javax
> > mail.
>
> Thank you for your tests!
>
> > So it seems a bit dangerous to use javax.mail since we will never know
> when
> > some emails will go to error folder because of OutOfMemory.
>
> Mime4j let us only to read messages and not to write/modify them. So we
> are stick to javamail by now. Furthermore we exposed javamail
> MimeMessage in Mailet APIs so we will able to change this dependency in
> james 3.0+.
>
> This tests are indeed useful to start planning changes for the next
> major release (3.0).
>
> > ----------------
> >
> > Other problem I encountered using mime4j (sample tester: MessageTree),
> it
> > raises exception when processing text/plain with charset ISO-8859-1.
> >
> > I saw that someone has incorporated mime4j into James, though still
> > experimental. But I don't find any version of James that contains
> mime4j.
>
> Sorry, but I've got no answers for this.
>
> Stefano
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>