2014-12-17 19:54:29 +00:00
|
|
|
Configuring MailHog
|
|
|
|
===================
|
|
|
|
|
2014-12-24 17:57:47 +00:00
|
|
|
You can configure MailHog using command line options or environment variables:
|
2014-12-17 19:54:29 +00:00
|
|
|
|
2014-12-24 19:25:02 +00:00
|
|
|
| Environment | Command line | Default | Description
|
|
|
|
| ------------------- | --------------- | --------------- | -----------
|
|
|
|
| MH_CORS_ORIGIN | -cors-origin | | If set, a Access-Control-Allow-Origin header is returned for API endpoints
|
|
|
|
| MH_HOSTNAME | -hostname | mailhog.example | Hostname to use for EHLO/HELO and message IDs
|
|
|
|
| MH_API_BIND_ADDR | -api-bind-addr | 0.0.0.0:8025 | Interface and port for HTTP UI server to bind to
|
|
|
|
| MH_UI_BIND_ADDR | -ui-bind-addr | 0.0.0.0:8025 | Interface and port for HTTP API server to bind to
|
|
|
|
| MH_MONGO_COLLECTION | -mongo-coll | messages | MongoDB collection name for message storage
|
|
|
|
| MH_MONGO_DB | -mongo-db | mailhog | MongoDB database name for message storage
|
|
|
|
| MH_MONGO_URI | -mongo-uri | 127.0.0.1:27017 | MongoDB host and port
|
|
|
|
| MH_SMTP_BIND_ADDR | -smtp-bind-addr | 0.0.0.0:1025 | Interface and port for SMTP server to bind to
|
|
|
|
| MH_STORAGE | -storage | memory | Set message storage: memory / mongodb
|
|
|
|
|
|
|
|
#### Note on HTTP bind addresses
|
|
|
|
|
|
|
|
If `api-bind-addr` and `ui-bind-addr` are identical, a single listener will
|
|
|
|
be used allowing both to co-exist on one port.
|
|
|
|
|
|
|
|
The values must match in a string comparison. Resolving to the same host and
|
|
|
|
port combination isn't enough.
|