Handling header in Undeliverable Message
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chris_dutoit
Posted On:   Friday, August 10, 2001 02:45 PM

My application needs to handle undeliverable messages.


When I send the email, I add my own header (eg. corrID: 432432). Then later I look at the inbox for the undeliverable messages and then use the corrID to correlate to some other data.


The problem is that my original header is not coming back as a Java Mail header (ie. getHeader() does not return it). If I view the message, its in there, but its not treated as a header.


Does anybody have any ideas on how to get this value or another suggestion to handle undeliverable email?


I'm desperate! Any help appreciated!

Re: Handling header in Undeliverable Message

Posted By:   Christopher_Pickslay  
Posted On:   Friday, August 10, 2001 05:34 PM

You could parse the actual message using a regular expression. Using Jakarta ORO (http://jakarta.apache.org/oro/), you'd call:


Perl5Util util = new Perl5Util();
util.match("m/corrID:\s*(\d+)/",messageString);
String corrID = util.group(1);
About | Sitemap | Contact