savonrb / savon-multipart

Heavy metal Ruby SOAP client with multipart support
MIT License
17 stars 48 forks source link

Binary parts corrupted #4

Closed ebeigarts closed 12 years ago

ebeigarts commented 12 years ago

Currently the \n char gets replaced with \r\n in binary parts:

My current workaround is:

module Mail
  class Message
    # Avoids calling {String#to_crlf} on binary parts.
    def raw_source=(value)
      if value.include?("Content-Transfer-Encoding: binary")
        @raw_source = value
      else
        @raw_source = value.to_crlf
      end
    end
  end
end

You can reproduce this with a PDF:

--uuid:f2520735-6098-4586-93f3-019733fc1404+id=4
Content-ID: <http://tempuri.org/1/634746078367623835>
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream

%PDF-1.3
....

Should I open a ticket for the mail gem?

rubiii commented 12 years ago

looks like a bug in the mail gem. please open a ticket over there. thanks.