mirror of
https://github.com/SSLMate/certspotter.git
synced 2025-12-17 20:34:20 +01:00
Add a helper function
This commit is contained in:
@@ -12,6 +12,7 @@ package monitor
|
||||
import (
|
||||
"crypto/rand"
|
||||
"encoding/hex"
|
||||
"os"
|
||||
)
|
||||
|
||||
const mailDateFormat = "Mon, 2 Jan 2006 15:04:05 -0700"
|
||||
@@ -23,3 +24,11 @@ func generateMessageID() string {
|
||||
}
|
||||
return hex.EncodeToString(randomBytes[:]) + "@selfhosted.certspotter.org"
|
||||
}
|
||||
|
||||
func sendmailPath() string {
|
||||
if envVar := os.Getenv("SENDMAIL_PATH"); envVar != "" {
|
||||
return envVar
|
||||
} else {
|
||||
return "/usr/sbin/sendmail"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user