Skip to content

Commit 4500a43

Browse files
ondrejbimanu7hatch
authored andcommitted
[FIX] multiple utf7 encoding
1 parent 0779fc8 commit 4500a43

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/gmail/client/base.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def deliver!(mail=nil, &block)
152152
# end
153153
def mailbox(name, &block)
154154
@mailbox_mutex.synchronize do
155-
name = Net::IMAP.encode_utf7(name.to_s)
155+
name = name.to_s
156156
mailbox = (mailboxes[name] ||= Mailbox.new(self, name))
157157
switch_to_mailbox(name) if @current_mailbox != name
158158

@@ -196,7 +196,10 @@ def mail_domain
196196
private
197197

198198
def switch_to_mailbox(mailbox)
199-
conn.select(mailbox) if mailbox
199+
if mailbox
200+
mailbox = Net::IMAP.encode_utf7(mailbox)
201+
conn.select(mailbox)
202+
end
200203
@current_mailbox = mailbox
201204
end
202205

0 commit comments

Comments
 (0)