look / fetcher

download email from POP3 or IMAP and do stuff with it.
MIT License
209 stars 40 forks source link

IMAP disconnect error #5

Closed subimage closed 14 years ago

subimage commented 14 years ago

Got this error while fetching IMAP email via Gmail

/Work/cashboard/site/trunk/vendor/rails/railties/lib/commands/runner.rb:45: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/imap.rb:288:in shutdown': Socket is not connected (Errno::ENOTCONN) from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/imap.rb:288:indisconnect' from /Work/cashboard/site/trunk/vendor/plugins/fetcher/lib/fetcher/imap.rb:69:in close_connection' from /Work/cashboard/site/trunk/vendor/plugins/fetcher/lib/fetcher/base.rb:33:infetch' from (eval):9 from /Library/Ruby/Gems/1.8/gems/lockfile-1.4.3/lib/lockfile.rb:284:in lock' from /Library/Ruby/Gems/1.8/gems/lockfile-1.4.3/lib/lockfile.rb:539:inattempt' from /Library/Ruby/Gems/1.8/gems/lockfile-1.4.3/lib/lockfile.rb:539:in catch' from /Library/Ruby/Gems/1.8/gems/lockfile-1.4.3/lib/lockfile.rb:539:inattempt' ... 7 levels... from /Work/cashboard/site/trunk/vendor/rails/railties/lib/commands/runner.rb:45 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire' from script/runner:3

Changing the "close_connection" method in imap.rb fixes the error.

# Delete messages and log out
def close_connection
  @connection.expunge
  @connection.logout
  @connection.disconnect unless @connection.disconnected?
end
look commented 14 years ago

I've pulled in exceed's changes which include this fix.