mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 09:54:40 +03:00
mox!
This commit is contained in:
14
mox-/msgid.go
Normal file
14
mox-/msgid.go
Normal file
@ -0,0 +1,14 @@
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user