mirror of
https://github.com/mjl-/mox.git
synced 2024-12-25 16:03:48 +03:00
afb182cb14
and add an alerting rule if the failure rate becomes >10% (e.g. expired certificate). the prometheus metrics includes a reason, including potential tls alerts, if remote smtp clients would send those (openssl s_client -starttls does). inspired by issue #237, where incoming connections were aborted by remote. such errors would show up as "eof" in the metrics.
14 lines
225 B
Go
14 lines
225 B
Go
//go:build !go1.21
|
|
|
|
// For go1.20 and earlier.
|
|
|
|
package tlsrpt
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// FormatAlert formats a TLS alert in the form "alert-<num>".
|
|
func FormatAlert(alert uint8) string {
|
|
return fmt.Sprintf("alert-%d", alert)
|
|
}
|