Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Commit

Permalink
MailHog setup instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid Makarov authored and lmakarov committed Mar 11, 2016
1 parent f802aa5 commit 65702a4
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Tools available inside the **cli** container:
- [Using Behat](/docs/behat.md)
- [Zero-configuration Debugging with Xdebug and PhpStorm](/docs/xdebug.md)
- [MySQL DB access for external tools](/docs/db-access.md)
- [Sending and capturing email](/docs/mail.md)
<a name="troubleshooting"></a>
Expand Down
50 changes: 50 additions & 0 deletions docs/mail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Sending and capturing email

Sending/capturing email support can be added via [MailHog](https://github.com/mailhog/MailHog).

Out-of-the box only capturing will be working.
For email delivery you will have to point MailHog to a working mail server/service.

## Setup

1. Add the `mail` service in `docker-compose.yml`

Replace `<project_name>` with your project name.

```
mail:
hostname: mail
image: mailhog/mailhog
expose:
- "80"
environment:
- MH_API_BIND_ADDR=0.0.0.0:80
- MH_UI_BIND_ADDR=0.0.0.0:80
- DOMAIN_NAME=mail.<project_name>.docker
- VIRTUAL_HOST=webmail.<project_name>.drude
```
2. Apply new configuration
```
dsh up
```
3. Install sSMPT in cli
```
dsh exec "sudo apt-get update && sudo apt-get install ssmtp -y"
```
4. Configure sSMPT in cli
Replace `<project_name>` with your project name.
```
dsh exec "sudo sed -i -e '/mailhub=/c mailhub=mail.<project_name>.docker:1025' -e '/#FromLineOverride=/c FromLineOverride=YES' /etc/ssmtp/ssmtp.conf"
```
MailHog web UI will be available at `http://webmail.<project_name>.drude`
These instructions are temporary. Tread them as a POC for using MailHog with Drude.
Steps 3 and 4 have to be performed any time the cli container gets reconfigured/updated.

0 comments on commit 65702a4

Please sign in to comment.