diff --git a/cmd/smtp-check/smtp-check.go b/cmd/smtp-check/smtp-check.go index dc96146..7bff34d 100644 --- a/cmd/smtp-check/smtp-check.go +++ b/cmd/smtp-check/smtp-check.go @@ -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 diff --git a/docs/man/smtp-check.1 b/docs/man/smtp-check.1 index d4ad3a4..228b0fe 100644 --- a/docs/man/smtp-check.1 +++ b/docs/man/smtp-check.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "smtp-check 1" -.TH smtp-check 1 "2018-04-02" "" "" +.TH smtp-check 1 "2023-07-16" "" "" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -142,7 +142,7 @@ smtp\-check \- SMTP setup checker .SH "SYNOPSIS" .IX Header "SYNOPSIS" -\&\fBsmtp-check\fR [\-port \fIport\fR] [\-skip_tls_check] \fIdomain\fR +\&\fBsmtp-check\fR [\-port \fIport\fR] [\-localname \fIdomain\fR] [\-skip_tls_check] \fIdomain\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" smtp-check is a command-line too for checking \s-1SMTP\s0 setups (\s-1DNS\s0 records, \s-1TLS\s0 @@ -152,6 +152,9 @@ certificates, \s-1SPF,\s0 etc.). .IP "\fB\-port\fR \fIport\fR:" 8 .IX Item "-port port:" Port to use for connecting to the \s-1MX\s0 servers. +.IP "\fB\-localname\fR \fIdomain\fR:" 8 +.IX Item "-localname domain:" +Local name to use for the \s-1EHLO\s0 command. .IP "\fB\-skip_tls_check\fR:" 8 .IX Item "-skip_tls_check:" Skip \s-1TLS\s0 check (useful if connections are blocked). diff --git a/docs/man/smtp-check.1.pod b/docs/man/smtp-check.1.pod index a35eaec..6246282 100644 --- a/docs/man/smtp-check.1.pod +++ b/docs/man/smtp-check.1.pod @@ -4,7 +4,7 @@ smtp-check - SMTP setup checker =head1 SYNOPSIS -B [-port I] [-skip_tls_check] I +B [-port I] [-localname I] [-skip_tls_check] I =head1 DESCRIPTION @@ -19,6 +19,10 @@ certificates, SPF, etc.). Port to use for connecting to the MX servers. +=item B<-localname> I: + +Local name to use for the EHLO command. + =item B<-skip_tls_check>: Skip TLS check (useful if connections are blocked).