Actions
Bug #4249
closedNet::IMAP gets a parse error response while sending multibyte mail
Description
=begin
RFC3501 which defines IMAP version 4 rev 1 said:
"A literal is a sequence of zero or more octets (including CR and LF), prefix-quoted with an octet count
in the form of an open brace ("{"), the number of octets, close brace ("}"), and CRLF."
current imap.rb sends the number of characters not the octet count while sending String to server.
def send_literal(str)
put_string("{" + str.length.to_s + "}" + CRLF)
...
end
I've attached the code to reproduce the bug, and a small patch.
if Net::IMAP is designed that it expects ASCII-8BIT String, this may not a bug though.
Net::IMAPを使ってUTF-8などでエンコードされたメールを、例えばAPPENDする際に、
バイト数ではなく文字数を送ってしまうために期待しない返答が返ります。
もし、Net::IMAPが常にASCII-8BITの文字列を期待するのであれば、バグではないと思います。
=end
Files
Updated by naruse (Yui NARUSE) almost 14 years ago
- Status changed from Open to Assigned
- Assignee set to shugo (Shugo Maeda)
=begin
=end
Updated by naruse (Yui NARUSE) almost 14 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
=begin
This issue was solved with changeset r30543.
Yoshimasa, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- lib/net/imap.rb: use bytesize for binary strings.
patched by Yoshimasa Niwa. [ruby-core:34222]
=end
Actions
Like0
Like0Like0