Can not read message content via imap
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, February 20, 2002 06:20 PM

The dumppart(Part p) method in the demo program msgshow.java in the javamail-1_2.zip seems not work well with imap. I uncommented the clause dumpPart(msgs[i]), and run java msgshow -L pop3://111:111@localhost, the message content was displayed as following , it's ok; Total messages = 1 New messages = 0 ------------------------------- -------------------------- MESSAGE #1: CONTENT-TYPE: multipart/alternative; boundary="----=_NextPart_000_001A_01C1BA39.2943DCA0" This is a Multipart --------------------------- CONTENT-TYPE: text/plain; charset="iso-8859-1" This is plain text --------------------------- Can you see test Content2? CONTENT-TYPE: text/html; cha   More>>

The dumppart(Part p) method in the demo program msgshow.java in the javamail-1_2.zip seems not work well with imap.

I uncommented the clause dumpPart(msgs[i]), and run java msgshow -L pop3://111:111@localhost, the message content was displayed as following , it's ok;

Total messages = 1
New messages = 0
-------------------------------
--------------------------
MESSAGE #1:
CONTENT-TYPE: multipart/alternative;
boundary="----=_NextPart_000_001A_01C1BA39.2943DCA0" This is a Multipart --------------------------- CONTENT-TYPE: text/plain; charset="iso-8859-1" This is plain text --------------------------- Can you see test Content2? CONTENT-TYPE: text/html; charset="iso-8859-1" This is a string ---------------------------

Can you see test Content2?



while I run java msshow -L imap://111:111@localhost, the following exception message was given:

Total messages = 1
New messages = 0
-------------------------------
--------------------------
MESSAGE #1:
Oops, got exception! null
java.lang.NullPointerException
at com.sun.mail.imap.IMAPMessage.getContentType(IMAPMessage.java:323)
at msgshow.dumpPart(msgshow.java:236)
at msgshow.main(msgshow.java:192)


What's the problem?    <<Less

Got it. It's the imap server's bug.

Posted By:   Anonymous  
Posted On:   Wednesday, February 20, 2002 08:34 PM

Thanks.
About | Sitemap | Contact