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

net/imap can't find imap.gmail.com #2060

Closed
tpitale opened this Issue Nov 28, 2012 · 5 comments

Comments

Projects
None yet
2 participants

tpitale commented Nov 28, 2012

require "net/map"
imap = Net::IMAP.new('imap.gmail.com', :port => 993, :ssl => true)

Fails on rbx-head irb (rubinius-2.0.0.rc1) installed with rvm on OS X 10.8.2 with "SocketError: nodename nor servname provided, or not known". I can ping imap.gmail.com and I can access it from MRI 1.9.3.

Owner

dbussink commented Nov 28, 2012

There are a few things here. The hash syntax is only added in 1.9, so this syntax will not work in 1.8 mode in Rubinius. In 1.9 mode I see a different error though that has a different cause.

tpitale commented Nov 29, 2012

If I get rid of the hash, and just call .new with 'imap.gmail.com' (since I'm in 1.8 mode, I thought I had set the default to 1.9, oh well), then the irb session is blocked. I'm not seeing an error in that case.

I'll try to see what I can see in 1.9 mode.

Owner

dbussink commented Nov 29, 2012

It also hangs in MRI 1.8 for me here, so probably the same there. I guess it doesn't automatically handle SSL in 1.8.

I'm working on a fix for the problem you're seeing when running this with 1.9 mode, should be done shortly. I'll also make it throw a similar error for the 1.8 case for this script.

Owner

dbussink commented Nov 29, 2012

If you use 1.8 mode, you do need to pass in true as an extra parameter to indicate SSL in net/imap:

require "net/imap"
imap = Net::IMAP.new('imap.gmail.com', 993, true)

@dbussink dbussink closed this in 5312a9b Nov 29, 2012

tpitale commented Nov 29, 2012

Thanks!

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