Question

I'm trying to export a mail message as EML but I want to strip a specific header field.

This code should remove all fields that contain the string $FolderRef.

for (int i = 0; i < headers.size(); i++) {
    MIMEHeader header = (MIMEHeader)headers.elementAt(i);
    if (header.getHeaderName().compareTo("X-Notes-Item") == 0 && header.getHeaderValAndParams().contains("$FolderRef")) {
        header.remove();
    }
}

Afterwards the mail is written to a stream and saved as an EML file, but the line with $FolderRef is still there.

How can I remove this headers before saving?

Was it helpful?

Solution

Removing the $FolderRef item before converting the note to a mime stream should work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top