Commit 189b72f2 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

Don't mangle \n and \r combinations in the generated mboxes

Generated mboxes weren't representing newline (aka LF or \n) and
carriage return (aka CR or \r) found in the original patch faithfully.

This is mostly due to how email.Message is implemented - it tries to
normalize newlines in plain text emails. This doesn't work for us as we
want to provide the patches in an unchanged form.

To do that we have to overwrite as_string() and as_bytes() methods on
our Message class that will use modified Generator that doesn't mangle
newlines.

The difference in the checksums is due to slightly different header
wrapping caused by the changes in generator.

Additionally tests are provided to make sure that we ingest emails
correctly (no mangling there) and that the generated mbox is also
a-okay.

Fixes: #33Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
parent fdb77357
Pipeline #172701 passed with stage
in 1 minute and 24 seconds