Runtime options - Mailpit
Documentation
Mailpit features
Installation
Configuration
Runtime options
Web UI & API server
SMTP server
POP3 server
SpamAssassin
TLS certificates
Password files
SMTP forwarding
SMTP relaying
Prometheus metrics
HTTP proxy
Data compression
Email storage
Troubleshooting
UI security policies
Unix domain sockets
Usage
Integration testing
Development
API (v1)
Mailtrap (for teams)
Runtime options
Mailpit’s runtime options are listed below. Please note that these are always current with the latest release and may differ from older releases.
General
--database
MP_DATABASE
Specify the local database filename to store persistent data. The default is a local temporary file which is auto-deleted when Mailpit exits.
You can optionally use a remote rqlite database by specifying a “http address” (
see docs
).
--disable-wal
MP_DISABLE_WAL
false
v1.23.0
Disable
Write-Ahead Logging
(WAL) support for local database.
WAL (enabled by default) provides better performance, however is not compatible with network file systems such as NFS or Samba.
Set this option if you intend to use persistent storage on a network volume.
--disable-version-check
MP_DISABLE_VERSION_CHECK
false
v1.26.2
Disable Mailpit’s automatic version checking. When enabled, Mailpit will not contact GitHub to check for new releases.
--disable-auto-vacuum
MP_DISABLE_AUTO_VACUUM
false
v1.29.5
Disable automatic VACUUMing of the local SQLite database. This is not recommended as it may lead to increased database file size and reduced performance over time
see docs
).
--compression
MP_COMPRESSION
v1.23.0
Compression level to store raw messages in the database (0-3) (
see docs
.)
--label
MP_LABEL
Set an optional label to identify this Mailpit instance. This adds the label to the web UI, SMTP and POP3 servers.
--tenant-id
MP_TENANT_ID
Set a tenant ID (table prefix). This is used to isolate the data from other Mailpit instances sharing the same data file (
see docs
).
--max
MP_MAX_MESSAGES
500
Maximum number of messages to store. Mailpit will periodically delete the oldest messages if greater than this.
Set to
to disable auto-deletion (
see docs
).
--max-age
MP_MAX_AGE
Maximum age of messages to store in either (h)ours or (d)ays. Mailpit will periodically delete the oldest messages if greater than this.
The value must be either in hours (eg:
--max-age 36h
) or days (eg:
--max-age 14d
) (
see docs
).
--use-message-dates
MP_USE_MESSAGE_DATES
false
Use message header date as the Mailpit received date & time instead of the SMTP-received date & time.
--ignore-duplicate-ids
MP_IGNORE_DUPLICATE_IDS
false
Ignore duplicate messages based on Message-Ids.
--log-file
MP_LOG_FILE
Log Mailpit output to file instead of stdout. eg:
--log-file /path/to/logfile.log
--quiet
MP_QUIET
false
Quiet logging (errors only)
--verbose
MP_VERBOSE
false
Verbose logging (debug)
Web UI & API
--listen
MP_UI_BIND_ADDR
0.0.0.0:8025
HTTP bind interface and port for UI.
--webroot
MP_WEBROOT
Set the webroot for web UI & API, for example
mail
would result in
--ui-auth-file
MP_UI_AUTH_FILE
Specify a password file for web UI & API basic authentication (
see docs
).
--ui-tls-cert
MP_UI_TLS_CERT
TLS certificate for web UI & API (ie:
HTTPS
). This option requires the
--ui-tls-key
argument or
MP_UI_TLS_KEY
environment variable to be set.
--ui-tls-key
MP_UI_TLS_KEY
TLS key for web UI & API (ie:
HTTPS
). This option requires the
--ui-tls-cert
argument or
MP_UI_TLS_CERT
environment variable to be set.
--api-cors
MP_API_CORS
Specify one or more hosts for CORS Access-Control-Allow-Origin to permit cross-domain browser requests to the API (
see docs
).
--block-remote-css-and-fonts
MP_BLOCK_REMOTE_CSS_AND_FONTS
false
Block all browser access to remote CSS and fonts imported via message stylesheets.
Mailpit uses the HTTP Content Security Policy (CSP) method to block these. This does not block remote images or clicking on external links.
--allow-internal-http-requests
MP_ALLOW_INTERNAL_HTTP_REQUESTS
false
v1.29.2
Allow Link Check and UI Screenshot to access internal (non-public) IPs when checking links or fetching remote assets (images, stylesheets, etc.). This is required for those features to work in test environments that use internal hostnames or IPs. Use caution in production - enabling this can allow SSRF (Server‑Side Request Forgery) if both your Mailpit UI and SMTP are reachable by untrusted users.
--enable-spamassassin
MP_ENABLE_SPAMASSASSIN
false
Enable SpamAssassin integration for message spamminess score (
see docs
).
--allow-untrusted-tls
MP_ALLOW_UNTRUSTED_TLS
false
Do not verify HTTPS certificates for either link checker & screenshot generation.
--disable-http-compression
MP_DISABLE_HTTP_COMPRESSION
false
Disable HTTP compression support in the web UI and API (
see docs
).
--hide-delete-all-button
MP_HIDE_DELETE_ALL_BUTTON
false
v1.25.0
Hides the “Delete all” button in the web UI. This can be useful if you explicitly do not want your users to use this feature
see docs
).
--send-api-auth-file
MP_SEND_API_AUTH_FILE
v1.26.0
Specify a password file for Send API authentication (
see docs
). This provides separate authentication credentials specifically for the
/api/v1/send
endpoint.
--send-api-auth-accept-any
MP_SEND_API_AUTH_ACCEPT_ANY
false
v1.26.0
Accept any username and password for the Send API endpoint, including none (
see docs
). This option cannot be used together with
--send-api-auth-file
SMTP server
--smtp
MP_SMTP_BIND_ADDR
0.0.0.0:1025
SMTP bind interface and port.
--smtp-auth-file
MP_SMTP_AUTH_FILE
Specify a password file for SMTP authentication (
see docs
).
--smtp-auth-accept-any
MP_SMTP_AUTH_ACCEPT_ANY
false
Accept any SMTP username and password, including none. Use this to basically allow anything.
--smtp-tls-cert
MP_SMTP_TLS_CERT
TLS certificate for SMTP STARTTLS. This option requires the
--smtp-tls-key
argument or
MP_SMTP_TLS_KEY
environment variable to be set.
--smtp-tls-key
MP_SMTP_TLS_KEY
TLS key for SMTP STARTTLS. This option requires the
--smtp-tls-cert
argument or
MP_SMTP_TLS_CERT
environment variable to be set.
--smtp-require-starttls
MP_SMTP_REQUIRE_STARTTLS
false
Require all SMTP clients to use STARTTLS encryption. If set to true, the only allowed commands are
NOOP, EHLO, STARTTLS and QUIT (as specified in RFC 4954) until the connection is upgraded to STARTTLS.
--smtp-require-tls
MP_SMTP_REQUIRE_TLS
false
Require all SMTP clients to use SSL/TLS encryption. If set to true, all connections to the SMTP server must be
handled over TLS. This is different to STARTTLS which requires the initial connection to be unencrypted.
Note that this option disables STARTTLS and may reduce client compatibility.
--smtp-auth-allow-insecure
MP_SMTP_AUTH_ALLOW_INSECURE
false
Typically either STARTTLS or TLS is enforced for all SMTP authentication. This option allows insecure PLAIN & LOGIN SMTP authentication when using STARTTLS.
--smtp-strict-rfc-headers
MP_SMTP_STRICT_RFC_HEADERS
false
Force Mailpit to return an SMTP error if message headers contain
\n
instead to
\r\n
line breaks.
By default Mailpit will silently fix incorrect line breaks generated by some broken sendmail clients (see related
Github issue
).
--smtp-max-recipients
MP_SMTP_MAX_RECIPIENTS
100
Maximum number of SMTP recipients allowed per message.
--smtp-allowed-recipients
MP_SMTP_ALLOWED_RECIPIENTS
Only allow SMTP recipients matching a regular expression. Use this to restrict incoming mail to only those sent to a pre-defined list.
An example would be
--smtp-allowed-recipients '@example.com$'
to only allow emails sent to recipients ending in
@example.com
--smtp-ignore-rejected-recipients
MP_SMTP_IGNORE_REJECTED_RECIPIENTS
v1.27.4
Silently ignore messages sent to rejected recipients (see
smtp-allowed-recipients
).
Messages to rejected recipients still receive a
250 OK
response, however the messages are ignored internally.
--smtp-disable-rdns
MP_SMTP_DISABLE_RDNS
false
Disable SMTP reverse DNS lookups.
SMTP will by default try resolve the hostname of the IP address of the connecting client, however in test networks this can sometimes be problematic
causing delays for every message delivered.
SMTP relay
--smtp-relay-config
MP_SMTP_RELAY_CONFIG
SMTP configuration file to enable message relay/release (
see docs
). Alternatively the entire configuration can be passed via
environment variables
--smtp-relay-all
MP_SMTP_RELAY_ALL
false
Automatically
relay
all
incoming messages via external SMTP server (
see docs
).
Use with extreme caution!
--smtp-relay-matching
MP_SMTP_RELAY_MATCHING
Automatically
relay some incoming messages to
matching
recipients via external SMTP server (
see docs
).
This will only relay to recipients matching a regular expression, and cannot be used in conjunction with
--smtp-relay-all
An example would be
--smtp-relay-matching '(user1@host1\.com|user2@host2\.com|@host3\.com)$'
SMTP forwarding
--smtp-forward-config
MP_SMTP_FORWARD_CONFIG
v1.22.0
SMTP configuration file to enable message forwarding (
see docs
). Alternatively the entire configuration can be passed via
environment variables
Chaos
--enable-chaos
MP_ENABLE_CHAOS
false
v1.22.0
Enable Chaos functionality (API / web UI) (
see docs
).
--chaos-triggers
MP_CHAOS_TRIGGERS
v1.22.0
Set the runtime Chaos triggers (
see docs
).
POP3 server
--pop3
MP_POP3_BIND_ADDR
0.0.0.0:1110
POP3 server bind interface and port.
--pop3-auth-file
MP_POP3_AUTH_FILE
Specify a password file for POP3 authentication (
see docs
).
Note
: this option is required to enable the POP3 server, or alternatively credentials can be specified via an
environment variable
--pop3-tls-cert
MP_POP3_TLS_CERT
TLS certificate for POP3 SSL/TLS. This option requires the
--pop3-tls-key
argument or
MP_POP3_TLS_KEY
environment variable to be set.
--pop3-tls-key
MP_POP3_TLS_KEY
TLS key for POP3 SSL/TLS. This option requires the
--pop3-tls-cert
argument or
MP_POP3_TLS_CERT
environment variable to be set.
Tagging
--tag
MP_TAG
Auto-tag new messages matching filters (
see docs
).
--tags-config
MP_TAGS_CONFIG
Load tags filters from yaml configuration file (
see docs
).
--tags-title-case
MP_TAGS_TITLE_CASE
false
Enforces TitleCasing for all newly-created tags (
see docs
).
--tags-disable
MP_TAGS_DISABLE
Disable specific auto-tagging. This option takes a comma-separated list of options (
see docs
).
--tags-username
MP_TAGS_USERNAME
false
v1.26.2
Automatically tag messages with the authenticated username (SMTP or HTTP). Useful for multi-user environments to easily filter and identify messages by user. When enabled, a tag matching the username will be added to each message sent by an authenticated user.
Prometheus metrics
--enable-prometheus
MP_ENABLE_PROMETHEUS
false
v1.26.0
Enable Prometheus metrics. Set to
true
to serve metrics on the main web UI port at
/metrics
or specify a bind address (e.g.,
0.0.0.0:9090
) to run a separate metrics server (
see docs
).
Webhook
--webhook-url
MP_WEBHOOK_URL
Call a webhook when new messages are received (
see docs
), eg:
--webhook-url https://example.com/webhook.php
--webhook-limit
MP_WEBHOOK_LIMIT
Rate limited webhook requests per second.
To prevent potentially overloading the webhook server, this is rate limited by default to a maximum of 1 request per second (
see docs
).
--webhook-delay
MP_WEBHOOK_DELAY
v1.29.0
Delay in seconds before sending webhook requests.
Edit this page
On this page
[[ r.item.title ]]
[[ r.item.description ]]
No results....
Type to start searching
US