Using mailcatcher with Homestead

I was recently made aware of mailcatcher, an awesome little tool to allow devs to run a mock SMTP server on their machine and direct their apps mail to it when developing / testing.

At VentureCraft we’re using Homestead to organize and keep dev environments in sync which is awesome, but caused some problems when we wanted to set mail settings in a mail.php config file when running in Homestead, since if I had mailcatcher running on my local machine I needed to point the mail config there, which would obviously cause issues for other developers working offset.

Here’s what we came up with.

First, I adding the following to my file:

sudo apt-get install ruby1.9.1-dev -y
sudo apt-get install libsqlite3-dev
sudo gem install mailcatcher

Then I have to SSH in and run mailcatcher –ip=

If I try add that line to the file, it complains that port 1025 is already in use for some reason.

( being the IP set in homestead.rb)

This does increase the boot up time quite a bit, which is annoying, but it works.

I can now hit to view the mail, and send to on port 1025 in my mail.php config file.

June 23, 2014

© 2020