0 votes
by (140 points)
edited

Hi, was wondering if Rebex Secure Mail supports EML made by Lotus Notes or "RFC822"? I could not get certain .EML files to parse properly.

Applies to: Rebex Secure Mail
by (147k points)
edited

Yes, RFC 822 messages should be supported, although some obsolete features might not fully work. Would it be possible to mail a sample of such .EML file to support@rebex.net for analysis? We should be easily able to tell what's wrong. (Please make sure to send the .EML file in a ZIP archive to prevent mailservers along the way from modifying it.)

1 Answer

0 votes
by (147k points)
edited

After looking into a supplied .EML file, it turned out the issue is different than what I originally thought.

The .EML file was not an old-style RFC822 message, but a broken MIME message that actually violates both not only RFC 822, but its newer versions (RFC 2822, RFC 5322) as well:

  1. It uses wrong end-of-line sequence (0A instead of 0D 0A).
  2. It contains an empty line at the beginning – before the actual headers (an empty line indicates end of headers and can't be the first line in a file because header-less messages are invalid).

To fix the message, use the following code:

    string contents = File.ReadAllText(path);
    contents = contents.TrimStart('\n').Replace("\n", "\r\n");
    File.WriteAllText(pathFixed, contents);

The fixed message can be loaded both by Rebex Secure Mail and third-party applications.

...