encoding fix

You need to call  message.body.split! p.body.boundary and fix the newline problem beforehand
If this is not done, than the Content-Transfer-Encoding is not properly set if the original message contained characters which needs encoding (it is set for whole message rather than part because message.body.split the Mail class thinks it is not multipart message but single large message).