Skip to content

Additional header parsers for email module #144053

@fostervbv

Description

@fostervbv

Feature or enhancement

Proposal:

A process question:
I have created additional header parsers for the email module. Is this of interest to the project? If so, it is best submitted as an independent module like dkimpy, as a Python Enhancement Proposal, or a standard pull following the developer guidelines?

These classes implement a best-effort attempt to parse header content that is often consistent but not standardized. This includes everything associated with the Received header, plus comment text in the Authentication Results and Received-SPF headers. Because the source data has unpredictable variability, the results will be less perfect than other parsers, and the code may require future tuning to cope with exceptions that are discovered in the future. Hence the question of whether you want to deal with them at all. On the other hand, these headers were very important to me, and they have been successfully utilized on my incoming mail stream over an extended time period. I wonder if they will be useful to others.

Here is a list of what I have built and am currently using.

MyReg.map_to_type('received',RcvHdrClass)

MyReg.map_to_type('dkim-signature',TokenValuePairs)
MyReg.map_to_type('arc-message-signature',TokenValuePairs)
MyReg.map_to_type('arc-seal',TokenValuePairs)

MyReg.map_to_type('arc-authentication-results',AuthResClass)
MyReg.map_to_type('authentication-results',AuthResClass)

MyReg.map_to_type('received-spf',RcvSpfClass)

MyReg.map_to_type('date',DateClass)			
# Default class does not handle time zone parameter

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-emailtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions