users@javamail.java.net

Re: Problem to parse file to mimemessage

From: David de Lucca <davidpadilha_at_gmail.com>
Date: Thu, 17 Jul 2014 10:26:03 -0300

Hey Bill!

Sorry for inconvenience. It's working now.

Thank you very much.

David



On Wed, Jul 16, 2014 at 4:44 PM, Bill Shannon <bill.shannon_at_oracle.com>
wrote:

> Using the msgshow.java sample program
> <https://java.net/projects/javamail/pages/Home#Samples> with "java
> msgshow -m < 000323CB.000000000000_57864639b610.txt" shows no problems
> parsing the file:
>
> This is the message envelope
> ---------------------------
> FROM: David L <lore_at_gmail.com> <lore_at_gmail.com>
> REPLY TO: David L <lore_at_gmail.com> <lore_at_gmail.com>
> TO: David L <lore_at_gmail.com> <lore_at_gmail.com>
> SUBJECT: test
> SendDate: Tue Jul 15 04:34:44 PDT 2014
> FLAGS:
> X-Mailer NOT available
> CONTENT-TYPE: multipart/alternative; boundary=047d7b604a1c4c255404fe39cbf3
> This is a Multipart
> ---------------------------
> CONTENT-TYPE: text/plain; charset=UTF-8
> This is plain text
> ---------------------------
> test email message
>
> CONTENT-TYPE: text/html; charset=UTF-8
> This is a string
> ---------------------------
> <div dir="ltr">test email message<br></div>
>
>
> Note that the message has both a MessageId header and a Message-ID header;
> make sure you're asking for the right one.
>
> If it's still not working for you, I need more details about how you're
> trying to read the headers.
>
> Also, what version of JavaMail are you using?
>
>
> David de Lucca wrote on 07/16/14 05:43:
>
> Hello folks,
>
> I'm parsing a text file to a MimeMessage but all values from headers are
> empty. If i go to debug window on eclipse and check variables, i can see an
> attribute called 'line' and this attribute has the correct values but the
> method 'getValue()', returns null.
>
> Here is what i see in my debug window:
>
> [10] InternetHeaders$InternetHeader (id=219)
> line "MessageId:12335" (id=234)
> name "MessageId" (id=235)
> value "" (id=232)
>
> This is the way that i parse my file to IS:
> var is = new FileInputStream(file)
> var session = Session.getDefaultInstance(new Properties())
> var mimeMessage = new MimeMessage(session, is)
>
>
>
> I've tried it using Java and Scala. First, i thought that was a problem with Scala but i've tried with Java 1.8 and same problem happened.
>
>
>
>
> Could you give me a hand, please? Maybe it's a bug or i forgot something. The file that i was using is in attachments.
>
>
>
> Thank you very much.
>
>
>