---
name: "mailtest"
section: "1"
platform: "linux"
package: "exim4-base"
version: "4.98.2-1+deb13u4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mailtest"
---

# mailtest(1)

Simple SMTP sending for diagnostics

## 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

- **--help**

  Print a brief help message and exits.

- **-d, --debug**

  Enables debugging, outpus additional information whilst processing requests.

- **-h, --host**=*host*

  Specifies the host to connect to. Must be specified and must be IP-resolvable.

- **-m, --ehlo**=*machine*

  Specified the machine name to use as the **EHLO** value. Defaults to the fully-qualified name of the host running the command.

- **-r, --rcptto**=*recipient*

  Specifies the recipient of message. This is used as the **RCPT TO** value.

- **-v, --vrfy**

  Uses the *recipient* parameter for the value in a **VRFY** request. This disables the sending of an email.

- **-e, --expn**

  Uses the *recipient* parameter for the value in an **EXPN** request. This disables the sending of an email.

- **-f, --mailfrom**=*from\_address*

  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.

- **-u, --from822**=*from\_user*

  Specified the value to use in the message headers. Defaults to the **-f** *from\_address* value unless the **-B** option is used.

- **-B, --bounce**

  Replace the **--mailfrom** *from\_address* with **\\\<\\**\> and the **--from833** *from\_user* with **mailer-daemon@host** where the host is the value of **--ehlo** *machine*

- **-p, --port**=*port*

  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.

- **-S, --tls**

  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**.

- **-s, --nostarttls**

  Disables attempting STARTTLS if offered. Disabled by use of **-S**.

- **--stricttls**

  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.

- **--sslargs**=argname=argvalue\[,argname=argvalue...\]

  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
  ```

- **-b, --body**

  Generate a body for the message being sent.

- **-O, --include-options**

  Include details of options used in the message body.

- **-H, --include-headers**

  Include a copy of the generated headers in the message body.

- **-w, --wellknown**=*well-known-path*

  Provides the path value for a **WELLKNOWN** command.

- **-W, --output**=*output\_file*

  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.
