mirror of
https://github.com/hanzoai/mail.git
synced 2026-09-23 23:53:02 +00:00
Fork of github.com/mjl-/mox at 5656ca6d1b
(upstream v0.0.15 plus 55 commits).
Rename the module path in go.mod and the import paths in 268 Go files. Also
update the five scripts that "go install" the module (genwebsite.sh,
docker-release.sh, apidiff.sh, test-upgrade.sh, Dockerfile.release), which
would otherwise build upstream rather than this fork.
Add NOTICE recording the upstream project, author, license, and fork point,
and stating which license covers which files: MIT for the mox source and our
changes, MPL-2.0 for publicsuffix/public_suffix_list.txt alone, and the
vendored dependencies' own licenses under licenses/. Embed NOTICE so
"mail licenses" prints the lineage from the running binary. LICENSE.MIT,
LICENSE.MPLv2.0 and the licenses/ tree are preserved verbatim; no code is
relicensed.
The mox command name, config keys, data directory layout and website content
are unchanged. LLM.md records the fork point, the rename, what was left alone,
and the steps to stand the server up.
Co-authored-by: Hanzo Dev <[email protected]>
22 lines
627 B
Go
22 lines
627 B
Go
package message
|
|
|
|
import (
|
|
"github.com/hanzoai/mail/dns"
|
|
)
|
|
|
|
// HeaderCommentDomain returns domain name optionally followed by a message
|
|
// header comment with ascii-only name.
|
|
//
|
|
// The comment is only present when smtputf8 is true and the domain name is unicode.
|
|
//
|
|
// Caller should make sure the comment is allowed in the syntax. E.g. for Received,
|
|
// it is often allowed before the next field, so make sure such a next field is
|
|
// present.
|
|
func HeaderCommentDomain(domain dns.Domain, smtputf8 bool) string {
|
|
s := domain.XName(smtputf8)
|
|
if smtputf8 && domain.Unicode != "" {
|
|
s += " (" + domain.ASCII + ")"
|
|
}
|
|
return s
|
|
}
|