Skip to content

Commit

Permalink
Add MailHog for local email testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ronilaukkarinen committed Sep 23, 2021
1 parent 465d7d3 commit 7c5dd9a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### 1.0.3: 2021-09-23

* Add MailHog for local email testing

### 1.0.2: 2021-03-24

* Start public versioning
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ wget -O - https://raw.githubusercontent.com/digitoimistodude/macos-lemp-setup/ma
3. [Requirements](#requirements)
4. [Installation](#installation)
5. [Post installations](#post-installations)
1. [Mailhog](#MailHog)
6. [Use Linux-style aliases](#use-linux-style-aliases)
7. [File sizes](#file-sizes)
8. [XDebug](#xdebug)
Expand Down Expand Up @@ -57,7 +58,7 @@ Read the full story by [@ronilaukkarinen](https://github.com/ronilaukkarinen): *
5. Check the version with `php --version`, it should match the linked file.
6. Brew should have already handled other links, you can test the correct versions with `sudo mysql --version` (if it's something like _mysql Ver 15.1 Distrib 10.5.5-MariaDB, for osx10.15 (x86_64) using readline 5.1_ it's the correct one) and `sudo nginx -v` (if it's something like nginx version: nginx/1.19.3 it's the correct one)
7. Add `export PATH="$(brew --prefix php@7.4)/bin:$PATH"` to .bash_profile (or to your zsh profile or to whatever term profile you are currently using)
8. Run [Post install](#post-install)
8. Go through [post installations](#post-installations)
9. Enjoy! If you use [dudestack](https://github.com/digitoimistodude/dudestack), please check instructions from [its own repo](https://github.com/digitoimistodude/dudestack).

### Post installations
Expand Down Expand Up @@ -136,6 +137,26 @@ sudo service nginx restart
sudo service mariadb restart
````

#### MailHog

E-mails won't be sent on local environment because there is no email server configured. This is where [MailHog](https://github.com/mailhog/MailHog) comes in.

MailHog should be pre-installed but if not, run following:

``` bash
brew update && brew install mailhog
```

Ensure you have the latest [air-helper](https://github.com/digitoimistodude/air-helper) or [MailHog for WordPress](https://wordpress.org/plugins/wp-mailhog-smtp/) activated to enable MailHog routing for local environment.

Then just run:

``` bash
mailhog
```

You should now get a log in command line and web interface is available in http://0.0.0.0:8025/.

### File sizes

You might want to increase file sizes for development environment in case you need to test compression plugins and other stuff in WordPress. To do so, edit `/usr/local/etc/php/7.4/php-fpm.d/www.conf` and `/usr/local/etc/php/7.4/php.ini` and change all **memory_limit**, **post_max_size** and **upload_max_filesize** to something that is not so limited, for example **500M**.
Expand Down
3 changes: 3 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ query_cache_limit = 512K
query_cache_size = 128M
skip-name-resolve" > "/usr/local/etc/my.cnf"
echo "${boldgreen}MariaDB installed and running.${txtreset}"
echo "${yellow}Installing MailHog.${txtreset}"
brew update && brew install mailhog
echo "${boldgreen}MailHog installed (run mailhog to start mail server).${txtreset}"
echo "${yellow}Installing DNSmasq.${txtreset}"
brew install dnsmasq
curl -L https://gist.githubusercontent.com/dtomasi/ab76d14338db82ec24a1fc137caff75b/raw/550c84393c4c1eef8a3e68bb720df561b5d3f175/dnsmasq.conf -o /usr/local/etc/dnsmasq.conf
Expand Down

0 comments on commit 7c5dd9a

Please sign in to comment.