mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-05 17:37:03 +00:00
smtp-check: Add flag to specify local name
Some MTAs reject client connections unless the local name (used in the HELO/EHLO command) looks like an FQDN. Currently, smtp-check always uses `localhost`, which does not look like an FQDN. This patch adds a command line flag to smtp-check to specify the local name to be used. Fixes https://github.com/albertito/chasquid/issues/37. Amended-by: Alberto Bertogli <albertito@blitiri.com.ar> Minor edits to the commit message, adjust flag name, go fmt.
This commit is contained in:
@@ -25,6 +25,8 @@ import (
|
||||
var (
|
||||
port = flag.String("port", "smtp",
|
||||
"port to use for connecting to the MX servers")
|
||||
localName = flag.String("localname", "localhost",
|
||||
"specify the local name for the EHLO command")
|
||||
skipTLSCheck = flag.Bool("skip_tls_check", false,
|
||||
"skip TLS check (useful if connections are blocked)")
|
||||
)
|
||||
@@ -91,6 +93,10 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
err = c.Hello(*localName)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
config := &tls.Config{
|
||||
// Expect the server to have a certificate valid for the MX
|
||||
|
||||
Reference in New Issue
Block a user