Duplicated folder. Gmail isn't case sensitive.
Opened this issue · 1 comments
carloscabanero commented
This issue happens whenever you have a folder with the same name but different casing between source and destination (ie. "folder" - "Folder"). IMAP protocol is case sensitive, but gmail isn't and throws a fatal error that stops the migration.
I coded a simple patch that adds a new quirk, that checks a regexp for the name.
def mailbox(name, delim = '/')
retries = 0
name.gsub!(/^(inbox\/?)/i){ $1.upcase }
name.gsub!(delim, self.delim)
name.gsub!(/\s+/, ' ') if @quirks[:gmail]
# Gmail doesn't allow folders with leading or trailing whitespace. \
name.strip! if @quirks[:gmail]
begin
if @quirks[:gmail]
# In Gmail folders are not case sensitive
update_mailboxes
@mailboxes.keys.each do |key|
if key =~ /^#{Regexp.quote(name)}$/i
return @mailboxes[key]
end
end
raise MailboxNotFoundError, "mailbox not found: #{name}"
end
@mailboxes.fetch(name) do
update_mailboxes
[....]
rgrove commented
Good catch. Would you mind sending a pull request with your patch?