Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Upcase 'inbox' in mailbox names like 'inbox/foo/bar'.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrove committed Dec 6, 2009
1 parent 957fd5e commit 482edcb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/larch/imap.rb
Expand Up @@ -136,8 +136,8 @@ def host
def mailbox(name, delim = '/')
retries = 0

name = name.gsub(delim, self.delim)
name = 'INBOX' if name.downcase == 'inbox'
name.gsub!(/^(inbox\/?)/i){ $1.upcase }
name.gsub!(delim, self.delim)

# Gmail doesn't allow folders with leading or trailing whitespace.
name.strip! if @quirks[:gmail]
Expand Down Expand Up @@ -349,6 +349,8 @@ def unsafe_connect
end

def update_mailboxes
debug "updating mailboxes"

all = safely { @conn.list('', '*') } || []
subscribed = safely { @conn.lsub('', '*') } || []

Expand All @@ -365,7 +367,7 @@ def update_mailboxes
end

# Remove mailboxes that no longer exist from the database.
@db_account.mailboxes.each do |db_mailbox|
@db_account.mailboxes_dataset.all do |db_mailbox|
db_mailbox.destroy unless @mailboxes.has_key?(db_mailbox.name)
end
end
Expand Down

0 comments on commit 482edcb

Please sign in to comment.