mail
mail copied to clipboard
Fix regression in content_type for text part after converted to multipart
This was broken by 404ecdd290f89658fb05da02ea5b6139fd82ebdb. It removed the setting of the default :content_type entry for the text part, before copying the content fields to the text part. This puts back the setting of the default :content_type entry for the text part.
In 2.7.1:
m = Mail.new
m.body 'c'
m.add_file :filename=>'a.txt', :content=>'b'
m.parts.first.content_type =~ /text\/plain/ # => 0
Before this commit:
m = Mail.new
m.body 'c'
m.add_file :filename=>'a.txt', :content=>'b'
m.parts.first.content_type =~ /text\/plain/ # => nil
m.encoded
m.parts.first.content_type =~/text\/plain/ # => 0
After this commit:
m = Mail.new
m.body 'c'
m.add_file :filename=>'a.txt', :content=>'b'
m.parts.first.content_type =~ /text\/plain/ # => 0
Regression found by Roda's mailer plugin tests.
Hi there @jeremyevans good work on this, sorry for the radio silence. Can you please rebase this against Master and against 2-8-stable and I'll get these released in the next updates.
@mikel OK, this is rebased against master. Would you like me to send a separate pull request that is against 2-8-stable?