Lotus Notes remove a header field before exporting as EML
-
25-10-2019 - |
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?
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