Missing body when removing signature of EML

Hello, I’ve observed an issue when loading a signed EML. When I remove the signature from it, the expected body is not there.

Here’s the code I’ve been using to load it:

MailMessage message = MailMessage.load("testSMIME.eml"), EmlLoadOptions());
MailMessage unsigned = message.removeSignature();
assertEquals("This is some sample content.", message.body); // fails because the body is empty

I’ve attached the sample EML along w/ a file containing the expected text.

testSMIME.zip (1.7 KB)

@biewers2 please note that "This is some sample content." text is not part of the body of the email, that text is set as the Preamble of the email.

Oh interesting, I didn’t know that was a thing, thanks!

It also appears the preamble is also null when the signature is removed.

@biewers2
thanks to point that.
Additionally, please note that (using the latest version of the package) after removing the signature the Preamble property is not null in the original MailMessage (which is the message that you are asserting), but it is null in the MailMessage generated by the removeSignature method.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): EMAILNET-41078

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

1 Like

Hi @biewers2
Your first post describing the problem is correct. The problem with an empty body for an unsigned message has now been fixed. The fix will be available in the next version 23.7. In this case, a non-empty preamble in a signed message is an error. This bug has also been fixed. Sorry for the inconvenience.

1 Like