Mailpit is an email testing tool for developers.
It acts as an SMTP server, and provides a web interface to view all captured emails.
Documentation:
https://github.com/axllent/mailpit
https://mailpit.axllent.org/docs/
Usage:
mailpit [flags]
mailpit [command]
Available Commands:
dump Dump all messages from a database to a directory
ingest Ingest a file or folder of emails for testing
readyz Run a healthcheck to test if Mailpit is running
reindex Reindex the database
sendmail A sendmail command replacement for Mailpit
version Display the current version & update information
Flags:
-d, --database string Database to store persistent data
--disable-wal[=true|false] Disable WAL for local database (allows NFS mounted DBs)
--disable-version-check[=true|false] Disable version update checking
--disable-auto-vacuum[=true|false] Disable auto-VACUUM for the database
--compression int Compression level to store raw messages (0-3) (default 1)
--label string Optional label identify this Mailpit instance
--tenant-id string Database tenant ID to isolate data
-m, --max int Max number of messages to store (default 500)
--max-age string Max age of messages in either (h)ours or (d)ays (eg: 3d)
--max-message-size int Maximum message size in MB (0 = unlimited) (default 50)
--use-message-dates[=true|false] Use message dates as the received dates
--ignore-duplicate-ids[=true|false] Ignore duplicate messages (by Message-ID)
--log-file string Log output to file instead of stdout
-q, --quiet[=true|false] Quiet logging (errors only)
-v, --verbose[=true|false] Verbose logging
-l, --listen string HTTP bind interface & port for UI (default "[::]:8025")
--allowed-hosts string Allowlist of Host header values, comma-separated (mitigates DNS rebinding)
--webroot string Set the webroot for web UI & API (default "/")
--ui-auth-file string A password file for web UI & API authentication
--ui-tls-cert string TLS certificate for web UI (HTTPS) - requires ui-tls-key
--ui-tls-key string TLS key for web UI (HTTPS) - requires ui-tls-cert
--api-cors string Set CORS origin(s) for the API, comma-separated (eg: example.com,foo.com)
--block-remote-css-and-fonts[=true|false] Block access to remote CSS & fonts
--allow-internal-http-requests[=true|false] Allow link checker, HTML checker & screenshots to access internal IP addresses
--disable-link-check-rate-limit[=true|false] Disable the per-domain rate limiter and result cache used by the link checker
--enable-spamassassin string Enable integration with SpamAssassin (<host>:<port>)
--enable-rspamd string Enable integration with Rspamd (https://<password>@<host>:<port>)
--allow-untrusted-tls[=true|false] Do not verify HTTPS certificates (link checker & screenshots)
--disable-http-compression[=true|false] Disable HTTP compression support (web UI & API)
--hide-delete-all-button[=true|false] Hide the "Delete all" button in the web UI
--send-api-auth-file string A password file for Send API authentication
--send-api-auth-accept-any[=true|false] Accept any username and password for the Send API endpoint, including none
-s, --smtp string SMTP bind interface and port (default "[::]:1025")
--smtp-auth-file string A password file for SMTP authentication
--smtp-auth-accept-any[=true|false] Accept any SMTP username and password, including none
--smtp-tls-cert string TLS certificate for SMTP (STARTTLS) - requires smtp-tls-key
--smtp-tls-key string TLS key for SMTP (STARTTLS) - requires smtp-tls-cert
--smtp-require-starttls[=true|false] Require SMTP client use STARTTLS
--smtp-require-tls[=true|false] Require client use SSL/TLS
--smtp-auth-allow-insecure[=true|false] Allow insecure PLAIN & LOGIN SMTP authentication
--smtp-strict-rfc-headers[=true|false] Return SMTP error if message headers contain <CR><CR><LF>
--smtp-max-recipients int Maximum SMTP recipients allowed (default 100)
--smtp-allowed-recipients string Only allow SMTP recipients matching a regular expression (default allow all)
--smtp-ignore-rejected-recipients[=true|false] Ignore rejected SMTP recipients with 2xx response
--smtp-disable-rdns[=true|false] Disable SMTP reverse DNS lookups
--smtp-relay-config string SMTP relay configuration file to allow releasing messages
--smtp-relay-all[=true|false] Auto-relay all new messages via external SMTP server (caution!)
--smtp-relay-matching string Auto-relay new messages to only matching recipients (regular expression)
--smtp-forward-config string SMTP forwarding configuration file for all messages
--enable-chaos[=true|false] Enable Chaos functionality (API / web UI)
--chaos-triggers string Enable Chaos & set the triggers for SMTP server
--pop3 string POP3 server bind interface and port (default "[::]:1110")
--pop3-auth-file string A password file for POP3 server authentication (enables POP3 server)
--pop3-tls-cert string Optional TLS certificate for POP3 server - requires pop3-tls-key
--pop3-tls-key string Optional TLS key for POP3 server - requires pop3-tls-cert
-t, --tag string Tag new messages matching filters
--tags-config string Load tags filters from yaml configuration file
--tags-title-case[=true|false] TitleCase new tags generated from plus-addresses and X-Tags
--tags-disable string Disable auto-tagging, comma separated (eg: plus-addresses,x-tags)
--tags-username[=true|false] Auto-tag messages with the authenticated username
--enable-prometheus string Enable Prometheus metrics: true|false|<ip:port> (eg:'0.0.0.0:9090')
--webhook-url string Send a webhook request for new messages
--webhook-limit int Limit webhook requests per second (default 1)
--webhook-delay int Delay in seconds before sending webhook requests (default 0)
Use "mailpit [command] --help" for more information about a command.
Options (64)
| Option | Description | Source |
|---|---|---|
-d, --database string | Database to store persistent data | help |
--disable-wal true|false | Disable WAL for local database (allows NFS mounted DBs) | help |
--disable-version-check true|false | Disable version update checking | help |
--disable-auto-vacuum true|false | Disable auto-VACUUM for the database | help |
--compression int | Compression level to store raw messages (0-3) (default 1) | help |
--label string | Optional label identify this Mailpit instance | help |
--tenant-id string | Database tenant ID to isolate data | help |
-m, --max int | Max number of messages to store (default 500) | help |
--max-age string | Max age of messages in either (h)ours or (d)ays (eg: 3d) | help |
--max-message-size int | Maximum message size in MB (0 = unlimited) (default 50) | help |
--use-message-dates true|false | Use message dates as the received dates | help |
--ignore-duplicate-ids true|false | Ignore duplicate messages (by Message-ID) | help |
--log-file string | Log output to file instead of stdout | help |
-q, --quiet true|false | Quiet logging (errors only) | help |
-v, --verbose true|false | Verbose logging | help |
-l, --listen string | HTTP bind interface & port for UI (default "[::]:8025") | help |
--allowed-hosts string | Allowlist of Host header values, comma-separated (mitigates DNS rebinding) | help |
--webroot string | Set the webroot for web UI & API (default "/") | help |
--ui-auth-file string | A password file for web UI & API authentication | help |
--ui-tls-cert string | TLS certificate for web UI (HTTPS) - requires ui-tls-key | help |
--ui-tls-key string | TLS key for web UI (HTTPS) - requires ui-tls-cert | help |
--api-cors string | Set CORS origin(s) for the API, comma-separated (eg: example.com,foo.com) | help |
--block-remote-css-and-fonts true|false | Block access to remote CSS & fonts | help |
--allow-internal-http-requests true|false | Allow link checker, HTML checker & screenshots to access internal IP addresses | help |
--disable-link-check-rate-limit true|false | Disable the per-domain rate limiter and result cache used by the link checker | help |
--enable-spamassassin string | Enable integration with SpamAssassin (<host>:<port>) | help |
--enable-rspamd string | Enable integration with Rspamd (https://<password>@<host>:<port>) | help |
--allow-untrusted-tls true|false | Do not verify HTTPS certificates (link checker & screenshots) | help |
--disable-http-compression true|false | Disable HTTP compression support (web UI & API) | help |
--hide-delete-all-button true|false | Hide the "Delete all" button in the web UI | help |
--send-api-auth-file string | A password file for Send API authentication | help |
--send-api-auth-accept-any true|false | Accept any username and password for the Send API endpoint, including none | help |
-s, --smtp string | SMTP bind interface and port (default "[::]:1025") | help |
--smtp-auth-file string | A password file for SMTP authentication | help |
--smtp-auth-accept-any true|false | Accept any SMTP username and password, including none | help |
--smtp-tls-cert string | TLS certificate for SMTP (STARTTLS) - requires smtp-tls-key | help |
--smtp-tls-key string | TLS key for SMTP (STARTTLS) - requires smtp-tls-cert | help |
--smtp-require-starttls true|false | Require SMTP client use STARTTLS | help |
--smtp-require-tls true|false | Require client use SSL/TLS | help |
--smtp-auth-allow-insecure true|false | Allow insecure PLAIN & LOGIN SMTP authentication | help |
--smtp-strict-rfc-headers true|false | Return SMTP error if message headers contain <CR><CR><LF> | help |
--smtp-max-recipients int | Maximum SMTP recipients allowed (default 100) | help |
--smtp-allowed-recipients string | Only allow SMTP recipients matching a regular expression (default allow all) | help |
--smtp-ignore-rejected-recipients true|false | Ignore rejected SMTP recipients with 2xx response | help |
--smtp-disable-rdns true|false | Disable SMTP reverse DNS lookups | help |
--smtp-relay-config string | SMTP relay configuration file to allow releasing messages | help |
--smtp-relay-all true|false | Auto-relay all new messages via external SMTP server (caution!) | help |
--smtp-relay-matching string | Auto-relay new messages to only matching recipients (regular expression) | help |
--smtp-forward-config string | SMTP forwarding configuration file for all messages | help |
--enable-chaos true|false | Enable Chaos functionality (API / web UI) | help |
--chaos-triggers string | Enable Chaos & set the triggers for SMTP server | help |
--pop3 string | POP3 server bind interface and port (default "[::]:1110") | help |
--pop3-auth-file string | A password file for POP3 server authentication (enables POP3 server) | help |
--pop3-tls-cert string | Optional TLS certificate for POP3 server - requires pop3-tls-key | help |
--pop3-tls-key string | Optional TLS key for POP3 server - requires pop3-tls-cert | help |
-t, --tag string | Tag new messages matching filters | help |
--tags-config string | Load tags filters from yaml configuration file | help |
--tags-title-case true|false | TitleCase new tags generated from plus-addresses and X-Tags | help |
--tags-disable string | Disable auto-tagging, comma separated (eg: plus-addresses,x-tags) | help |
--tags-username true|false | Auto-tag messages with the authenticated username | help |
--enable-prometheus string | Enable Prometheus metrics: true|false|<ip:port> (eg:'0.0.0.0:9090') | help |
--webhook-url string | Send a webhook request for new messages | help |
--webhook-limit int | Limit webhook requests per second (default 1) | help |
--webhook-delay int | Delay in seconds before sending webhook requests (default 0) | help |