Legacy bug in net/imap in Ruby 1.9.x

T

T. N. T.

Hello

Since I'm using Rails 2.3.8 with Ruby 1.9.2 the sent emails are cut-off
at the end. Not always but only in non-multipart mails where the headers

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

apply to the content (in multipart mails Tmail makes the text/plain-part
have Content-Transfer-Encoding: Quoted-printable).

This fixes the problem:

module Net
class IMAP
def send_literal(str)
put_string("{" + str.bytesize.to_s + "}" + CRLF)
@continuation_request_arrival.wait
raise @exception if @exception
put_string(str)
end
end
end

The change is "str.length.to_s" -> "str.bytesize.to_s".

Regards, T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top