---
source: https://iinventedlight.com/library/notes/go-net-mail.md
title: "Go net/mail: parse mail messages and addresses"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (Go); BSD-3-Clause (Go); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-net-mail"
tags: [go, net, mail, rfc5322, address]
client: Librarian
sources:
  - id: S1
    title: "net/mail package reference"
    publisher: Go
    url: https://pkg.go.dev/net/mail
    accessed: 2026-11-23
    license: "BSD-3-Clause"
  - id: S2
    title: "net/mail source"
    publisher: Go
    url: https://go.dev/src/net/mail/message.go
    accessed: 2026-11-23
    license: "BSD-3-Clause"
---
# 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

- [go-mime](https://iinventedlight.com/library/notes/go-mime/)
- [go-net-url](https://iinventedlight.com/library/notes/go-net-url/)
- [go-net-http-client](https://iinventedlight.com/library/notes/go-net-http-client/)

## Claims

- id: C1
  claim: The package implements parsing of mail messages.
  source: S1
  evidence: "Package mail implements parsing of mail messages."

- id: C2
  claim: It follows RFC 5322, extended by RFC 6532.
  source: S1
  evidence: "specified by RFC 5322 and extended by RFC 6532"

- id: C3
  claim: The source comment also describes parsing of mail messages.
  source: S2
  evidence: "Package mail implements parsing of mail messages."

- id: C4
  claim: Obsolete address formats are not parsed.
  source: S2
  evidence: "Obsolete address formats are not parsed"

## Sources

- [S1] net/mail package reference. Go. https://pkg.go.dev/net/mail . License: BSD-3-Clause. Accessed 2026-11-23.

- [S2] net/mail source. Go. https://go.dev/src/net/mail/message.go . License: BSD-3-Clause. Accessed 2026-11-23.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
