Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Running mailcatcher on a linux virtual machine #89

Closed
st32lthx opened this Issue Apr 30, 2013 · 13 comments

Comments

Projects
None yet
10 participants

I have installed the Mailcatcher gem (http://mailcatcher.me/) on my VM managed by Vagrant. And in the Vagrantfile I have set up the forwarding port:

config.vm.forward_port 1080, 1080

I ssh to the guest, run the Mailcatcher on the guest, but when I go to: 127.0.0.1:1080 on my host, I don't see the Mailcather interface. All I get is:

No data received.Unable to load the webpage because the server sent no data ...

Any ideas?

Thanks in advance!

Owner

sj26 commented Apr 30, 2013

Do you get HTML when you curl http://localhost:1080 on the vagrant vm?

If it's a port forwarding issue I have no idea, sorry—I don't use vagrant. Are you absolutely sure your port forwarding is correct, and in the correct direction?

On Wed, May 1, 2013 at 9:09 AM, Amin Meyghani notifications@github.com
wrote:

I have installed the Mailcatcher gem (http://mailcatcher.me/) on my VM managed by Vagrant. And in the Vagrantfile I have set up the forwarding port:
config.vm.forward_port 1080, 1080
I ssh to the guest, run the Mailcatcher on the guest, but when I go to: 127.0.0.1:1080 on my host, I don't see the Mailcather interface. All I get is:
No data received.Unable to load the webpage because the server sent no data ...
Any ideas?

Thanks in advance!

Reply to this email directly or view it on GitHub:
#89

Yes, I get the markup of the dashboard when I run curl. Can I use something like that to confirm my local test emails? Just curious :)

About port forwarding: I run my rails app with port forwarding (for example: 3000, 8080) so the forwarding works there. It is kind of strange that Vagrant can't forward mailcatcher on 1080. Maybe I am doing something wrong. I read another article about setting up mailcatcher on a VM, and that article suggested another port, I tried it and still no success :(

All I need to do is to use Mailcatcher to confirm emails in my rails app in development mode.

I would appreciate any help :)

Thanks again!

Owner

sj26 commented Apr 30, 2013

You could try running mailcatcher using:

$ mailcatcher --ip=0.0.0.0

This means you can access mailcatcher on your VM host using your VM's ip and port 1080, no vagrant forwarding required.

Awesome !!!! Thanks very much! I killed the process, and then I did what you said: (mailcatcher --ip=0.0.0.0) and I accessed it on the host on http://localhost:1080

Thanks again!

@sj26 sj26 closed this May 1, 2013

I tried the command above but got the error "invalid option: --ip=0.0.0.0 (OptionParser::InvalidOption)"
Instead, this command worked for me:

mailcatcher --http-ip=0.0.0.0
Owner

sj26 commented Jul 1, 2014

@joeyfrich there is definitely an ip option so you may be using an old version. Try gem install mailcatcher to upgrade.

This may be a bit of an old thread, but I have somewhat the same issue. I get a connection refused (ERR_CONNECTION_REFUSED) when I try to login through the browser. However, when I curl, it outputs the correct HTML. Any reason why the browser can be blocking this call?

Fixed: just a matter of vagrant blocking ports to outside world, just need to forward port in Vagrant file like so "config.vm.network :forwarded_port, guest: 1080, host: 1080"

I confirm that, on a Vagrant Ubuntu VM it works by :

  • adding a port forwarding in Vagrantfile
    => config.vm.network :forwarded_port, host: 1080, guest: 1080
  • launching mailcatcher
    => mailcatcher --http-ip=0.0.0.0

Thank you @sj26

Moulde commented Jul 9, 2015

Thanks, the command mailcatcher --ip=0.0.0.0 solved my issues. But i think in my issue it was nothing more than the mailcatcher daemon not running - i just didnt know you could start it using that command.

sgb-io commented Jul 23, 2015

thanks @sj26 !

Indeed the solution with the --http-ip flag did the trick, cheers!

I just did mailcatcher --ip 192.168.10.10, in which 192.168.10.10 is the VM IP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment