Discover Packages
github.com/Anonyfox/lfr
internal
addr
package
Version:
v0.2.2
Opens a new window with list of versions in this module.
Published: Oct 24, 2026
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package addr normalizes email addresses, domain names and host names, the
one place deciding what lfr accepts as an address.
ErrInvalid matches every error about a malformed address or domain, so
callers can tell bad input from failures without reading the message.
Base strips a +tag from a local part: "jo+news" → "jo".
Domain returns the lowercase ASCII (punycode) form of a domain or host name.
DomainOf returns the domain of an address, or "" when it has none.
Email parses and returns the normalized address string.
Invalid is an error about a malformed address that matches ErrInvalid.
Local validates and lowercases a local part as lfr hands them out: letters,
digits and . _ - + only, no leading or trailing dot.
type Address struct{ Local, Domain string }
Address is a normalized mailbox address.
Parse accepts a bare address or "Name <addr>" and normalizes it. The local
part keeps its characters (other servers' addresses may use anything RFC
5321 allows) but is lowercased, which every real mail system treats alike.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.