Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running mailcatcher on a linux virtual machine #89

Closed
st32lthx opened this issue Apr 30, 2013 · 15 comments
Closed

Running mailcatcher on a linux virtual machine #89

st32lthx opened this issue Apr 30, 2013 · 15 comments

Comments

@st32lthx
Copy link

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!

@sj26
Copy link
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

@st32lthx
Copy link
Author

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!

@sj26
Copy link
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.

@st32lthx
Copy link
Author

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 as completed May 1, 2013
@joeyfrich
Copy link

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

@sj26
Copy link
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.

@augsteyer
Copy link

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"

@herveguetin
Copy link

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

@mikedhart
Copy link

Thank you @sj26

@Moulde
Copy link

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
Copy link

sgb-io commented Jul 23, 2015

thanks @sj26 !

@cristianfrasineanu
Copy link

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

@facundofarias
Copy link

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

@jhonatanpetronilho
Copy link

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

Thannkkss!!!!

@64kramsystem
Copy link

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.

I've experienced the same issue, and I've found that the problem is that using --http-ip 0.0.0.0 is necessary to access the web interface from external hosts (otherwise, connections are refused).

@sj26 I suggest to document this somewhere, because it's not obvious, and there's a high risk to spend time looking for the cause somewhere else (firewall(s), typically) before finding the actual solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests