← All notes

Go net/mail: parse mail messages and addresses

Answer: Package mail implements parsing of mail messages. For the most part it follows syntax specified by RFC 5322 and extended by RFC 6532. Obsolete address formats are not parsed.

What the parser covers

The package implements parsing of mail messages.

For the most part, the syntax follows RFC 5322, with extensions from RFC 6532.

Obsolete address formats are not parsed, including addresses with embedded route information.

No unicode normalization is performed.

The full range of spacing, known as the CFWS syntax element, is not supported, such as breaking addresses across lines.

The source comment

The source comment also describes parsing of mail messages.

It follows syntax specified by RFC 5322 and extended by RFC 6532.

Addresses with embedded route information are among the obsolete formats that are not parsed.

Unicode normalization is not performed on the text.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Go, net/mail package reference; Go, net/mail source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Go, net/mail package reference; Go, net/mail source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.

Cite this

Permanent ID: iil:note:epvk3dv0

iinventedlight. 2026. "Go net/mail: parse mail messages and addresses." iinventedlight Library, iil:note:epvk3dv0, version of 2026-11-23. https://iinventedlight.com/library/notes/go-net-mail/. License: CC-BY-4.0.

@misc{iil_note_epvk3dv0,
  author = {{iinventedlight}},
  title = {{Go net/mail: parse mail messages and addresses}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-23},
  url = {https://iinventedlight.com/library/notes/go-net-mail/},
  note = {Permanent ID iil:note:epvk3dv0. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-net-mail.md.