Skip to content

Commit

Permalink
Correct call used to get folder list
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyates committed May 6, 2016
1 parent 2696707 commit f30467d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
11 changes: 0 additions & 11 deletions lib/email/provider.rb
Expand Up @@ -37,15 +37,4 @@ def host
'mail.messagingengine.com'
end
end

def root
case provider
when /@gmail\.com/
'/'
when /@fastmail\.fm/
'INBOX'
else
'/'
end
end
end
9 changes: 2 additions & 7 deletions lib/imap/backup/account/connection.rb
Expand Up @@ -20,10 +20,9 @@ def initialize(options)

def folders
return @folders if @folders
root = provider_root
@folders = imap.list(root, '*')
@folders = imap.list('', '*')
if @folders.nil?
Imap::Backup.logger.warn "Unable to get folder list for account #{username}, (root '#{root}'"
Imap::Backup.logger.warn "Unable to get folder list for account #{username}"
end
@folders
end
Expand Down Expand Up @@ -105,9 +104,5 @@ def server
def provider_options
provider.options.merge(connection_options)
end

def provider_root
provider.root
end
end
end
6 changes: 0 additions & 6 deletions spec/unit/email/provider_spec.rb
Expand Up @@ -31,10 +31,4 @@
expect(subject.host).to eq('imap.gmail.com')
end
end

describe '#root' do
it 'returns root' do
expect(subject.root).to eq('/')
end
end
end

0 comments on commit f30467d

Please sign in to comment.