dcparker / ruby-gmail

A Rubyesque interface to Gmail. Connect to Gmail via IMAP and manipulate emails and labels. Send email with your Gmail account via SMTP. Includes full support for parsing and generating MIME messages.
http://dcparker.github.com/ruby-gmail
790 stars 123 forks source link

Disconnect method #38

Closed amalhotra closed 12 years ago

amalhotra commented 12 years ago

I was running a process that would login to gmail parse messages, logout and repeat. Unfortunately the number of open TCP sockets for this process kept increasing with time and at some point (hours later) my process crashed with a Too many open connections error.

Added a disconnect method which basically calls @imap.disconnect. Let me know if you need me to tweak it. Thanks for the library.