Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

retrieving "Thread-Index" #52

Open
GoogleCodeExporter opened this issue Jun 17, 2015 · 1 comment
Open

retrieving "Thread-Index" #52

GoogleCodeExporter opened this issue Jun 17, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

How should I retrieve the non-standard "Thread-Index" headers value.

Original issue reported on code.google.com by [email protected] on 14 Oct 2011 at 6:30

@GoogleCodeExporter
Copy link
Author

Seems that it's not parsed by java-libpst. You may try getting it from the SMTP 
headers:

/* code begins */

private String extractHeaderValue(String header, String headers) {
    Pattern p = Pattern.compile("\\n" + header + ": ([^\\n\\r]*)");
    Matcher m = p.matcher(headers);
    if (m.find()) {
        return m.group(1);
    }
    return null;
}


PSTMessage message = ...

// Find Thread-Index in SMTP headers, may be null if not set.
String smtpHeaders = message.getTransportMessageHeaders();
String threadIndex = extractHeaderValue("Thread-Index", smtpHeaders);   

/* code ends */

Original comment by [email protected] on 20 Jan 2012 at 9:35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant