Subject: | Parsing should preserve the raw (folded) form of headers |
For some uses, it is important to be able to recreate a given header exactly as it appeared in the original.
For example, when using DKIM to sign an email, if the sender uses the "simple" canonicalization method, then the DKIM signature is based on the raw byte-for-byte original header, including folding.
If you parse a DKIM signed email and then regenerate it with Courriel, this breaks the signing.
The fix is to preserve all the original whitespace in the header and store that as a new raw_string attribute for Courriel::Header objets. The as_string method should use this raw value when stringifying the header.
This raw_string attribute should store the the whole header (key & value) as it was seen in the original email, including all whitespace and line endings.