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
Actions
Like0
Like0Like0