Scroll to navigation

MAILTEST(1) EXIM4 MAILTEST(1)

NAME

mailtest - Simple SMTP sending for diagnostics

SYNOPSIS

mailtest --host host.example.com --rcptto recipient@example.com [ send_options ... ] [ additional recipients ...]

Options:
--help
brief help message
--debug
enable debugging

  --host host
                host to connect to
  --rcptto recipient
                recipient for message
  --helo machine
                machine name for EHLO
  --vrfy        request VRFY of recipient
  --expn        request EXPN of recipient
  --mailfrom from
                use as MAIL FROM value
  --from822 from
                content From:
  --port port
                port to connect to
  --body            generate body
  --include_options
                include Options in body
  --include_headers
                include generated headers in body
  --tls         perform TLS on connect
  --nostarttls  do no attempt STARTTLS
  --stricttls   Enable strict verification on TLS connection
  --tlsargs arg=value[,arg=value]
                Explicitly define TLS options.
  --bounce      sending as bounce (<>)
  --wellknown path
                well-known path
  --output file
                Output file to receive well-known data

OPTIONS

Print a brief help message and exits.
Enables debugging, outpus additional information whilst processing requests.
Specifies the host to connect to. Must be specified and must be IP-resolvable.
Specified the machine name to use as the EHLO value. Defaults to the fully-qualified name of the host running the command.
Specifies the recipient of message. This is used as the RCPT TO value.
Uses the recipient parameter for the value in a VRFY request. This disables the sending of an email.
Uses the recipient parameter for the value in an EXPN request. This disables the sending of an email.
Specified the value to use in the MAIL FROM command. Defaults to the current username at the FQDN of the machine -m unless the -B option is used.
Specified the value to use in the message headers. Defaults to the -f from_address value unless the -B option is used.
Replace the --mailfrom from_address with \<\> and the --from833 from_user with mailer-daemon@host where the host is the value of --ehlo machine
Specified the port to connect to on the specified host. Defaults to port 25 unless -S is given in which case it defaults to 465.
Specifies that TLS be used directly on the connection prior to any SMTP commands. Changes the connection port to 465 unless it has been explicitly provided. Disables any attempts at STARTTLS.
Disables attempting STARTTLS if offered. Disabled by use of -S.
Enables strict verification of the TLS connection. Sets the underlying SSL option SSL_verify_mode to 1/SSL_VERIFY_PEER rather than 0/SSL_VERIFY_NONE. Since the aim of this tool is to test the SMTP protocol behaviour and not the TLS behaviour the decision was made to default the SSL_verify_mode to 0/SSL_VERIFY_NONE.
Allow full control over underlying SSL options. Overrides --stricttls. See the documentation for IO::Socket::SSL for further details.

    --sslargs SSL_verifycn_name=certname.example.com
    
Generate a body for the message being sent.
Include details of options used in the message body.
Include a copy of the generated headers in the message body.
Provides the path value for a WELLKNOWN command.
Provides the output file where the WELLKNOWN data should be stored.

DESCRIPTION

mailtest is a simple utility for testing SMTP connections. It is designed to debug endpoints and not for full email generation.

It support a number of basic operations, SEND, VRFY, EXPN, WELLKNOWN.

COMPATIBILITY

"mailtest" only requires modules that should be in all normal distributions.

AUTHOR

Bernard Quatermass <bernardq@exim.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2008,2020,2024 by Bernard Quatermass.

2024-07-03 perl v5.38.2