From 7c5dd9a4472ac52495d41233ba4798cf253182e2 Mon Sep 17 00:00:00 2001 From: Roni Laukkarinen Date: Thu, 23 Sep 2021 13:44:14 +0300 Subject: [PATCH] Add MailHog for local email testing --- CHANGELOG.md | 7 +++++++ README.md | 23 ++++++++++++++++++++++- install.sh | 3 +++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..722fe51 --- /dev/null +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index 46f0b55..112546e 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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**. diff --git a/install.sh b/install.sh index f122612..391e67e 100644 --- a/install.sh +++ b/install.sh @@ -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