This commit is contained in:
Mechiel Lukkien
2023-01-30 14:27:06 +01:00
commit cb229cb6cf
1256 changed files with 491723 additions and 0 deletions

16
smtp/addrlit.go Normal file
View File

@ -0,0 +1,16 @@
package smtp
import (
"net"
)
// AddressLiteral returns an IPv4 or IPv6 address literal for use in SMTP.
func AddressLiteral(ip net.IP) string {
// ../rfc/5321:2309
s := "["
if ip.To4() == nil {
s += "IPv6:"
}
s += ip.String() + "]"
return s
}