1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-07 17:47:14 +00:00

smtp-check: Add a -skip_tls_check flag

This patch adds a -skip_tls_check flag, so smtp-check can still be used
from places where outgoing SMTP connections are blocked.
This commit is contained in:
Alberto Bertogli
2017-01-04 13:36:28 -03:00
parent 6479138c57
commit 700539876b

View File

@@ -17,6 +17,8 @@ import (
var (
port = flag.String("port", "smtp",
"port to use for connecting to the MX servers")
skipTLSCheck = flag.Bool("skip_tls_check", false,
"skip TLS check (useful if connections are blocked)")
)
func main() {
@@ -56,6 +58,9 @@ func main() {
}
}
if *skipTLSCheck {
log.Printf("TLS check skipped")
} else {
c, err := smtp.Dial(mx.Host + ":" + *port)
if err != nil {
log.Fatal(err)
@@ -75,9 +80,11 @@ func main() {
log.Printf("TLS OK: %s - %s", tlsconst.VersionName(cstate.Version),
tlsconst.CipherSuiteName(cstate.CipherSuite))
log.Printf("")
c.Close()
}
log.Printf("")
}
log.Printf("=== Success")
}