summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/feed2imap.rb1
-rw-r--r--lib/feed2imap/imap.rb5
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb
index 72743f5..a2474be 100644
--- a/lib/feed2imap/feed2imap.rb
+++ b/lib/feed2imap/feed2imap.rb
@@ -232,7 +232,6 @@ class Feed2Imap
@logger.info("Closing IMAP connections ...")
@config.imap_accounts.each_value do |ac|
begin
- ac.logout
ac.disconnect
rescue
# servers tend to cause an exception to be raised here, hence the INFO level.
diff --git a/lib/feed2imap/imap.rb b/lib/feed2imap/imap.rb
index 038833b..933a561 100644
--- a/lib/feed2imap/imap.rb
+++ b/lib/feed2imap/imap.rb
@@ -77,7 +77,10 @@ class ImapAccount
# disconnect from the IMAP server
def disconnect
- @connection.disconnect if @connection
+ if @connection
+ @connection.logout
+ @connection.disconnect
+ end
end
# Returns true if the folder exist