Skip to content

Parsing should preserve the raw (folded) form of headers #6

@autarch

Description

@autarch

Migrated from rt.cpan.org #84449 (status was 'new')

Requestors:

From drolsky@cpan.org (@autarch) on 2013-04-05 17:39:36:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions