Skip to content

Latest commit

 

History

History
71 lines (46 loc) · 1.51 KB

File metadata and controls

71 lines (46 loc) · 1.51 KB

Mailpit

Mailpit is a small, fast, low memory, zero-dependency, multi-platform email testing tool & API for developers.

It acts as an SMTP server, provides a modern web interface to view & test captured emails, and contains an API for automated integration testing

See https://mailpit.axllent.org/

It receives and stores the mails (temporarily) local and gives you a web interface to access them.

Install Mailpit

Install using homebrew:

brew install mailpit

Start the Mailpit service:

brew services start mailpit

Go to the web based interface http://127.0.0.1:8025.

Configure postfix

We will force PHP to send out email trough sendmail. But just to be sure we will set Mailpit as the relayhost of postfix:

sudo vi /etc/postfix/main.cf

Add following line at the end of the config file:

relayhost = 127.0.0.1:1025

Configure PHP

Every PHP version needs to be updated so email are send locally to MailHog instead of to real users:

sed -e 's/;*sendmail_path =.*/sendmail_path = \/opt\/homebrew\/bin\/mailpit sendmail test@test/' -i.bak $(brew --prefix)/etc/php/[VERSION]/php.ini

Note : Run the command multiple times and replace [VERSION] by the different installed PHP versions (8.4, 8.5, ...).

Restart PHP to activate configuration changes

sphp 8.5

Source