Vvv: Mailcatcher not working on fresh install

Created on 26 Apr 2018  Â·  19Comments  Â·  Source: Varying-Vagrant-Vagrants/VVV

Fresh VVV setup, Mailcatcher is not working.

I had to use an SMTP plugin to get it working. Is this right? If so, why does VVV come with Mailcatcher installed?

bug support wontfix

Most helpful comment

I have some experience installing Mailhog using the ScotchBox build scripts, which I've forked here https://github.com/jonathanbossenger/unnamed-development-box/blob/master/install.sh. I'd be keen to give this a bash.

I made some progress with MailHog and honestly it's significantly simpler/easier to both setup and use, and more reliable. I'd much prefer to eliminate mailcatcher and the need for another ruby dependency in favor of Golang and MailHog

I notice that VVV uses Postfix, is there a specific requirement for this? The reason I ask is that the Mailhog install I have working uses https://github.com/mailhog/mhsendmail and I'm not sure if there would be a conflict?

I don't know what role postfix plays, and I expect any MailHog install would have mhsendmail anyway. Nobody should be sending real emails from VVV machines anyway

All 19 comments

Is this running master or develop?

If you are referring to the VVV branch, I just cloned the repo, so what ever the main branch is set to.

I had the same problem using a fresh install from 2-2-release with the php7.2 utility configured on my vvv-custom.yml.

The solution was to enable the PHP module and restart php7.2-fpm:

sudo phpenmod mailcatcher
sudo service php7.2-fpm restart

I've provisioned the 2-2-release using php71 utility, and when I go to vvv.test:1080 I get error connection refused.

I went to vagrant ssh and started mailcatcher

agrant@vvv:~$ mailcatcher
Starting MailCatcher
==> smtp://127.0.0.1:1025
/usr/local/rvm/gems/ruby-2.4.1@mailcatcher/gems/thin-1.5.1/lib/thin/server.rb:104: warning: constant ::Fixnum is deprecated
==> http://127.0.0.1:1080
*** MailCatcher runs as a daemon by default. Go to the web interface to quit.

I tried with

sudo phpenmod mailcatcher
sudo service php7.1-fpm restart

But the mailcatcher won't work.

mailcatcher is made in ruby so is difficult that a php restart can help on this point.

maybe the port is not redirect correctly

Not sure. At this point, I think I'll have to destroy my box and do a manual install.

I'm also having the same issue +1

Mailcatcher is broken, we need somebody to replace it with MailHog, until somebody steps up it remains broken. I'm inclined to close this as wontfix and direct users to #1485

I have some experience installing Mailhog using the ScotchBox build scripts, which I've forked here https://github.com/jonathanbossenger/unnamed-development-box/blob/master/install.sh. I'd be keen to give this a bash.

I notice that VVV uses Postfix, is there a specific requirement for this? The reason I ask is that the Mailhog install I have working uses https://github.com/mailhog/mhsendmail and I'm not sure if there would be a conflict?

I have some experience installing Mailhog using the ScotchBox build scripts, which I've forked here https://github.com/jonathanbossenger/unnamed-development-box/blob/master/install.sh. I'd be keen to give this a bash.

I made some progress with MailHog and honestly it's significantly simpler/easier to both setup and use, and more reliable. I'd much prefer to eliminate mailcatcher and the need for another ruby dependency in favor of Golang and MailHog

I notice that VVV uses Postfix, is there a specific requirement for this? The reason I ask is that the Mailhog install I have working uses https://github.com/mailhog/mhsendmail and I'm not sure if there would be a conflict?

I don't know what role postfix plays, and I expect any MailHog install would have mhsendmail anyway. Nobody should be sending real emails from VVV machines anyway

I'm having the same issue with a fresh install. When I run vagrant up I see the following error:

    default:  * Mailcatcher [not installed]
    default: Building native extensions.  This could take a while...
    default: ERROR:  Error installing mailcatcher:
    default:    ERROR: Failed to build gem native extension.
    default: 
    default:         /usr/bin/ruby1.9.1 extconf.rb
    default: /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
    default:    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    default:    from extconf.rb:2:in `<main>'
    default: 
    default: 
    default: Gem files will remain installed in /var/lib/gems/1.9.1/gems/eventmachine-1.0.9.1 for inspection.
    default: Results logged to /var/lib/gems/1.9.1/gems/eventmachine-1.0.9.1/ext/gem_make.out
    default: Regenerating system wrappers
    default: .............
    default: Could not find file 'mailcatcher' nor '/usr/local/rvm/wrappers/system/mailcatcher'.
    default: Could not find file 'catchmail' nor '/usr/local/rvm/wrappers/system/catchmail'.
    default:  * Mailcatcher upstart already configured.

I found an old issue about it here but was not able to resolve. I have rvm on my machine:

C02VJ0G9HTD8:vagrant-local username$ rvm list
rvm rubies
   ruby-2.2.1 [ x86_64 ]
=* ruby-2.3.1 [ x86_64 ]

From some of what I was reading it sounded like I would need to upgrade ruby but if I did vagrant ssh and upgraded it there (which wasn't working for me anyway), then this would be lost next time the box was provisioned right?

I see the suggestions in this thread to migrate to mailhog but am wondering is it possible to just not use either? if so how would I do this? It is not functionality we need with this project and this issue has been blocking me for some time now. Would really appreciate any pointers - am relatively new to this so may have overlooked something simple.

@RoseanneC is it preventing you from provisioning? It shouldn't, you should be able to just ignore it

As for the quoted issue, there's a PR that fixes that by adding the ruby-dev package to the list in provisioner.sh, and while that fixes the provisioner message, it doesn't fix mailcatcher which still refuses to start.

As I mentioned though, unless you need this functionality you can just ignore it

Thanks so much for the very quick reply :)
Do you have a link to that PR with details on what to add to provisioner.sh and I will add that?

I had assumed that the mailcatcher error was why it was not provisioning for me..

When I go to http://local.wordpress.test/ I can see that site but I cannot see my custom site - I just get the page with this error: "Problem: Could not load the site, this implies that provisioning the site failed, please check there were no errors during provisioning, and reprovision."

I've checked my hosts file and it has been added in their correctly. I actually have another installation of Vagrant on my machine - could that be causing any issues? I wanted to set this project up in a fresh install so I could test it as there is going to be a group of volunteers working on this project on Wednesday.. The only other issue I have seen after running vagrant up is to do with composer:

Do not run Composer as root/super user! See https://getcomposer.org/root for details
    default: Installing phpmyadmin/phpmyadmin (4.8.1)
    default:   - Installing phpmyadmin/phpmyadmin (4.8.1): 
    default: Loading from cache
    default: Created project in .
    default: Loading composer repositories with package information
    default: Installing dependencies from lock file
    default: Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.

However I have seen this in my other installation which works so am assuming this is not preventing provisioning.

Thanks again for the speedy reply - I am keen to get this set up as soon as I can.

@RoseanneC is it just a specific site or the entire thing? If your sites load fine at the end then you're ok, best to raise a new issue so we can focus on mailcatcher here. Be sure to post your vvv-custom.yml and a link to a gist with your full provision output. Make sure as well you only run one instance of VVV at a time, only 1 thing can bind to port 80 at a time, running multiple local dev environments can cause conflicts

Thank you so much - I have submitted this as a separate issue :https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1545 with the gist attached showing provision output and the vvv-custom.yml
I have checked and only one instance of VVV is running.
(The default site http://local.wordpress.test/ loads fine - just my custom ones don't)

I'm closing this out as wontfix in favour of mailhog, we've a PR almost done in testing that replaces mailcatcher

In case anyone happens to be struggling to uninstall mailcatcher on vvv2 to free up port 1025, so mailhog can start correctly:

Mailcatcher isn't a ruby gem in it's own right in ruby (or at least not listed in Local Gems on running gem list. Instead I was seeing this process - and killing it just spawned another one:

$ ps aux | grep 'mailcatcher'
root     11668  0.1  2.4 128616 25300 ?        Ssl  17:40   0:00 ruby /usr/local/rvm/gems/ruby-2.4.1@mailcatcher/bin/mailcatcher --foreground --http-ip=0.0.0.0

As a ruby novice, I couldn't see any rvm commands to manipulate individual gems (just some stuff about 'gemsets'), so eventually to get rid of it, I just deleted the entire ruby-2.4.1@mailcatcher/ directory (in /usr/local/rvm/gems) and killed it again…

@wturrell the mailhog and mailcatcher services are controlled by:

https://github.com/Varying-Vagrant-Vagrants/VVV/blob/develop/config/init/vvv-start.conf

Since mailcatcher got removed from that file and replaced, that suggests that all you need to do is reprovision, if that's not the case then that's a bug and should be a new issue

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomjn picture tomjn  Â·  4Comments

tomjn picture tomjn  Â·  3Comments

ghost picture ghost  Â·  5Comments

rwrobe picture rwrobe  Â·  4Comments

zachwills picture zachwills  Â·  4Comments