headerfold

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package headerfold restores the fold points of daemon-projected DKIM2 header field values for adapters that write header fields themselves.

The dkim2d REST projection removes every CRLF of a library-rendered field but keeps the whitespace that followed it. The library's frozen field grammar emits a TAB only directly after such a CRLF, so every TAB after the first value octet marks one original fold point. The package lives in the library because the library is the only module both adapters share. Adapters that hand fields to an MTA must restore those line breaks: a DKIM2-Signature with a large RSA set or many recipients is several kilobytes long and would otherwise exceed the RFC 5322 line limit.

Index

Constants

View Source
const MaxLineOctets = 998

MaxLineOctets is the RFC 5322 physical line limit without the line ending.

Variables

This section is empty.

Functions

func Restore

func Restore(value string) string

Restore returns value with an LF line break before every TAB that follows other content, the LF-terminated folded form that Postfix Milter replies and Exim transport filters expect. A TAB at the very start is post-colon whitespace, not a fold point, and is kept byte-exact. Values without such a TAB are returned unchanged.

func WithinLineLimit

func WithinLineLimit(name, folded string) bool

WithinLineLimit reports whether every physical line of a folded field, counting "name:" on the first line, fits the RFC 5322 line limit.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL