Forum: Ruby Mail Fetcher : TCPSocket.open issue

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
30e4c9142032f31df2fe0d20672a4c2e?d=identicon&s=25 Vipin Vm (vmvipin)
on 2009-01-01 13:09
Hi All,

I want to featch mails from gmail using rails. Am following
http://www.iannopollo.com/articles/2008/02/17/mail...
link for that. But am getting an error.

Timeout::Error (execution expired):
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:54:in
`open'
    ./vendor/plugins/mail-fetcher/lib/net/pop.rb:519:in `do_start'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:56:in
`timeout'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:76:in
`timeout'
    ./vendor/plugins/mail-fetcher/lib/net/pop.rb:522:in `do_start'
    ./vendor/plugins/mail-fetcher/lib/net/pop.rb:508:in `start'
    ./vendor/plugins/mail-fetcher/lib/net/pop.rb:383:in `start'
    /app/controllers/users_controller.rb:128:in `fetch_mail'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in
`send'
    /Library/Ruby/Gems/1.8/gems/actionpack-2.1.0/lib/action_controller/base.rb:1162:in
`perform_action_without_filters'

I have downloaded mail-fetcher plugin and added it in my controller file
(require 'vendor/plugins/mail-fetcher/lib/mail_fetcher.rb'). But its
getting stuck here.

Net::POP3.start("mail.google.com", nil, "username", "password") do |pop|
and s = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
(pop.rb:519)

When i tried with irb its gave me this error

Apples-iMac-Vipin:~ vipin$ irb
>> require 'socket'
=> true
>> require 'open-uri'
=> true
>> s = TCPSocket.open("gmail.com", 587) ; s.close
Errno::ETIMEDOUT: Operation timed out - connect(2)
        from (irb):3:in `initialize'
        from (irb):3:in `open'
        from (irb):3
>>

Any ideas?
This topic is locked and can not be replied to.