mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:04:39 +03:00
mox!
This commit is contained in:
16
smtp/addrlit.go
Normal file
16
smtp/addrlit.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user