添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
hi:

I have some code to receive eml files,It works ok in most cases, but
lately I have found some eml files where teh code throws an exception.
It happens mostly while getting attachments,The exception is:



nested exception is:
java.io.IOException: Error in encoded stream: needed 4 valid base64
characters but only got 2 before EOF, the valid characters were: "Sn"
Filter trigger matched. Restarting JVM.
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:454)
at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:182)
at smtp_adapter.MailReceive.isAttach(MailReceive.java:318)
at MailReceive.ServiceReceive.putListener(ServiceReceive.java:145)
at MailReceive.ServiceReceive.run(ServiceReceive.java:63)

the code:

if (part.isMimeType("multipart/*")) {

Multipart mp = (Multipart) part.getContent();



for (int i = 0; i < mp.getCount(); i++)
{
BodyPart mpart = mp.getBodyPart(i);


I can open the eml with an email client ,please help me

any idea?
thanks
Mickle

===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
hi:

I have some code to receive eml files,It works ok in most cases, but
lately I have found some eml files where teh code throws an exception.
It happens mostly while getting attachments,The exception is:



nested exception is:
java.io.IOException: Error in encoded stream: needed 4 valid base64
characters but only got 2 before EOF, the valid characters were: "Sn"
Filter trigger matched. Restarting JVM.
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:454)
at javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:182)
at smtp_adapter.MailReceive.isAttach(MailReceive.java:318)
at MailReceive.ServiceReceive.putListener(ServiceReceive.java:145)
at MailReceive.ServiceReceive.run(ServiceReceive.java:63)

the code:

if (part.isMimeType("multipart/*")) {

Multipart mp = (Multipart) part.getContent();

int count = mp.getCount(); -------->throw exception

for (int i = 0; i < count; i++)
{
BodyPart mpart = mp.getBodyPart(i);
...
}
}


I can open the eml with an email client ,How can I parse it correctly?
help me please

thanks
Mickle

===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
Post by Mickle Wu
I have some code to receive eml files,It works ok in most cases, but
lately I have found some eml files where teh code throws an exception.
java.io.IOException: Error in encoded stream: needed 4 valid base64
characters but only got 2 before EOF, the valid characters were: "Sn"
Well, most likely you've encountered a message that was improperly
encoded to begin with. See the javadocs for the javax.mail.internet
package for a list of properties you can set. You can set a property
to cause such errors to be ignored, if that's what you want.

===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".