how do I parse a RFC822 formated file?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, April 2, 2003 02:08 PM

I would like to write a JAVA program to alter to, cc, bcc domains located in a RFC822 formated file.

Is there a way using Javamail getHeader(), etc... to wrap the FileReader and FileWriter to change these domains?

Please advise.

Re: how do I parse a RFC822 formated file?

Posted By:   Eugene_Kuleshov  
Posted On:   Wednesday, April 2, 2003 06:55 PM

You can create Message instance, change any fields in it and then write it back.

Session session = Session.getInstance( System.getProperties());
MimeMessage msg = new MimeMessage( session, fileInputStream);

...

msg.writeTo( fileOutputStream);

Actually this is the best way to "serialize" messages without using the JavaMail Storage.
About | Sitemap | Contact