Skip to content

Commit

Permalink
Fix #16 (on the right branch this time!)
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-kent committed Dec 17, 2014
1 parent 537f51a commit fb29858
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 21 deletions.
14 changes: 14 additions & 0 deletions CONFIG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Configuring MailHog
===================

You can configure Go-MailHog using command line options or environment variables:

| Environment | Command line | Default | Description
| ------------------- | ------------- | --------------- | -----------
| MH_HOSTNAME | -hostname | mailhog.example | Hostname to use for EHLO/HELO and message IDs
| MH_HTTP_BIND_ADDR | -httpbindaddr | 0.0.0.0:8025 | Interface and port for HTTP server to bind to
| MH_MONGO_COLLECTION | -mongocoll | messages | MongoDB collection name for message storage
| MH_MONGO_DB | -mongodb | mailhog | MongoDB database name for message storage
| MH_MONGO_URI | -mongouri | 127.0.0.1:27017 | MongoDB host and port
| MH_SMTP_BIND_ADDR | -smtpbindaddr | 0.0.0.0:1025 | Interface and port for SMTP server to bind to
| MH_STORAGE | -storage | memory | Set message storage: memory / mongodb
40 changes: 40 additions & 0 deletions DEPLOY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Deploying MailHog
=================

### Command line

You can run MailHog locally from the command line.

go get github.com/ian-kent/MailHog/MailHog
MailHog

To configure MailHog, use the environment variables or command line flags
described in the [README](README.md).

### Using supervisord/upstart/etc

MailHog can be started as a daemon using supervisord/upstart/etc.

See [this example init script](https://github.com/geerlingguy/ansible-role-mailhog/blob/master/files/mailhog)
and [this Ansible role](https://github.com/geerlingguy/ansible-role-mailhog) by [geerlingguy](https://github.com/geerlingguy).

### Docker

The example [Dockerfile](Dockerfile) can be used to run MailHog in a [Docker](https://www.docker.com/) container.

### Elastic Beanstalk

You can deploy Go-MailHog using [AWS Elastic Beanstalk](http://aws.amazon.com/elasticbeanstalk/).

1. Open the Elastic Beanstalk console
2. Create a zip file containing the Dockerfile and MailHog binary
3. Create a new Elastic Beanstalk application
4. Launch a new environment and upload the zip file

If you're using in-memory storage, you can only use a single instance of
Go-MailHog. To use a load balanced EB application, use MongoDB backed storage.

To configure your Elastic Beanstalk MailHog instance, either:

* Set environment variables using the Elastic Beanstalk console
* Edit the Dockerfile to pass in command line arguments
28 changes: 7 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Go was chosen for portability - MailHog runs without installation on multiple pl

### Getting started

Either:

* [Download the latest release](RELEASES.md) of Go-MailHog for your platform
* Use Docker or AWS Elastic Beanstalk to deploy Go-MailHog with the example [Dockerfile](Dockerfile)

By default, the SMTP server will start on port 1025, the HTTP server will start
on port 8025, and in-memory message storage will be used.
1. Either:
* [Download the latest release](RELEASES.md) of Go-MailHog for your platform
* [Read the deployment guide](DEPLOY.md) for other deployment options
2. [Configure MailHog](CONFIG.md), or use the default settings:
* the SMTP server will start on port 1025
* the HTTP server will start on port 8025
* in-memory message storage will be used.

### Features

Expand All @@ -40,20 +40,6 @@ on port 8025, and in-memory message storage will be used.

![Screenshot of MailHog web interface](/images/MailHog.png "MailHog web interface")

### Configuration

You can configure Go-MailHog using command line options or environment variables:

| Environment | Command line | Default | Description
| ------------------- | ------------- | --------------- | -----------
| MH_HOSTNAME | -hostname | mailhog.example | Hostname to use for EHLO/HELO and message IDs
| MH_HTTP_BIND_ADDR | -httpbindaddr | 0.0.0.0:8025 | Interface and port for HTTP server to bind to
| MH_MONGO_COLLECTION | -mongocoll | messages | MongoDB collection name for message storage
| MH_MONGO_DB | -mongodb | mailhog | MongoDB database name for message storage
| MH_MONGO_URI | -mongouri | 127.0.0.1:27017 | MongoDB host and port
| MH_SMTP_BIND_ADDR | -smtpbindaddr | 0.0.0.0:1025 | Interface and port for SMTP server to bind to
| MH_STORAGE | -storage | memory | Set message storage: memory / mongodb

### Contributing

Clone this repository to ```$GOPATH/src/github.com/ian-kent/Go-MailHog``` and type ```make deps```.
Expand Down

0 comments on commit fb29858

Please sign in to comment.