From: Daniel Cormier Date: 2011-02-12T00:13:17+09:00 Subject: [ruby-core:35202] Patch to Net::InternetMessageIO --0016e6d7e034254792049c032320 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable =A0=A0This patch addresses an issue when sending a message with Net::SMTP where the last line starts with a period and does not end with \n or \r\n. =A0=A0The result of this problem is that the period at the beginning of that line is not escaped. This is especially a problem when the line contains only a period. When this is the case then the message is ended rather than the period being sent as part of the email, then '\r\n.\r\n' is sent a second time (as the class does not expect the message to have ended) resulting in the mail server returning an error. Attached along with the patch are two emails that show the issue. If you try to send the contents of bad.eml with Net::SMTP, the email will be sent (without its trailing period), but you will get an error. If you try to send the contents of good.eml with Net::SMTP it will work correctly and you will receive the trailing period. CHANGELOG: Now properly sends the last line of an email when it begins with a period and does not end with \n or \r\n. Thanks, Daniel --0016e6d7e034254792049c032320 Content-Type: text/plain; charset=US-ASCII; name="bad.eml" Content-Disposition: attachment; filename="bad.eml" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gk18d5q21 VG86IDxib2d1c0BlbWFpbC5kb21haW4+CkZyb206IDxib2d1ZEBlbWFpbC5jb20+ClN1YmplY3Q6 IEVycm9yCgpUaGlzIG1lc3NhZ2UgZW5kcyB3aXRoIGEgcGVyaW9kIGFuZCBubyBcbiBvciBcclxu LgpUaGVyZSB3aWxsIGJlIGFuIGVycm9yIGlmIHlvdSB0cnkgdG8gc2VuZCBpdCB3aXRoIE5ldDo6 U01UUC4KCi4= --0016e6d7e034254792049c032320 Content-Type: application/octet-stream; name="ruby-changes.patch" Content-Disposition: attachment; filename="ruby-changes.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gk17o6o00 SW5kZXg6IHByb3RvY29sLnJiCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHByb3RvY29sLnJiCShyZXZpc2lvbiAz MDg0MykKKysrIHByb3RvY29sLnJiCSh3b3JraW5nIGNvcHkpCkBAIC0yODgsNyArMjg4LDcgQEAK ICAgICAgIEB3YnVmID0gJycKICAgICAgIHlpZWxkCiAgICAgICBpZiBub3QgQHdidWYuZW1wdHk/ ICAgIyB1bnRlcm1pbmF0ZWQgbGFzdCBsaW5lCi0gICAgICAgIHdyaXRlMCBAd2J1Zi5jaG9tcCAr ICJcclxuIgorICAgICAgICB3cml0ZTAgQHdidWYuc3ViKC9cQVwuLywgJy4uJykuY2hvbXAgKyAi XHJcbiIKICAgICAgIGVsc2lmIEB3cml0dGVuX2J5dGVzID09IDAgICAjIGVtcHR5IHNyYwogICAg ICAgICB3cml0ZTAgIlxyXG4iCiAgICAgICBlbmQK --0016e6d7e034254792049c032320 Content-Type: text/plain; charset=US-ASCII; name="good.eml" Content-Disposition: attachment; filename="good.eml" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gk18d5q52 VG86IDxib2d1c0BlbWFpbC5kb21haW4+CkZyb206IDxib2d1ZEBlbWFpbC5jb20+ClN1YmplY3Q6 IFN1Y2Nlc3MKClRoaXMgbWVzc2FnZSBlbmRzIHdpdGggYSBwZXJpb2QgYW5kIHRoZW4gYSBuZXds aW5lLgpZb3Ugd2lsbCBiZSBhYmxlIHRvIHNlbmQgaXQgd2l0aCBOZXQ6OlNNVFAuCgouCg== --0016e6d7e034254792049c032320--