mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
15 lines
352 B
Go
15 lines
352 B
Go
|
package mox
|
||
|
|
||
|
import (
|
||
|
"encoding/base64"
|
||
|
)
|
||
|
|
||
|
var messageIDRand = NewRand()
|
||
|
|
||
|
// MessageIDGen returns a generated unique random Message-Id value, excluding <>.
|
||
|
func MessageIDGen(smtputf8 bool) string {
|
||
|
buf := make([]byte, 16)
|
||
|
messageIDRand.Read(buf)
|
||
|
return base64.RawURLEncoding.EncodeToString(buf) + "@" + Conf.Static.HostnameDomain.XName(smtputf8)
|
||
|
}
|