mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 18:24:35 +03:00
smtpserver: add prometheus metric for failing starttls handshakes for incoming deliveries
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.
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func formatAlert(alert uint8) string {
|
||||
// FormatAlert formats a TLS alert in the form "alert-<num>".
|
||||
func FormatAlert(alert uint8) string {
|
||||
return fmt.Sprintf("alert-%d", alert)
|
||||
}
|
||||
|
Reference in New Issue
Block a user