Meatballs1/metasploit-framework — pull request #35 by jvazquez-r7 (2014-02-11 18:23:32+00:00)
Title: Try to better fix the MIME messages creation

As @jlee-r7 pointed yesterday, Rex::MIME::Message will be still wasting (binary) contents when SMTP multipart messages (for example). This pull tries to solve the Rex::MIME::Message in two ways:

1) Not adding extra "\r\n" between parts. As far as I can say it was unexpected, wasn't it?
2) Avoiding CRLF forcing on contents, no matters what type of contents they are.

Extra thoughts:

* I think contents shouldn't be modified by CRLF enforcing, no matters if they are binary or not. If it is known to cause problems I can just avoid crlf enforcing for contents with a content-type defined (or a list of content-types).
* There is still self.contents, which can be wasted by forcing CRLF, but self.contents is only populated when there is data on the constructor call, which doesn't happen in any module. The only point calling Rex::MIME::Message.new with data is in the NExpose module (lib/rapid7/nexpose.rb), and it's done to make easy parsing of a multipart message. So I think it's good enough to keep CRLF encoding on self.contents.

Thoughts? Am I forgetting something?