mail icon indicating copy to clipboard operation
mail copied to clipboard

Fix regression in content_type for text part after converted to multipart

Open jeremyevans opened this issue 6 years ago • 2 comments

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.

jeremyevans avatar Mar 21 '19 17:03 jeremyevans

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 avatar Dec 03 '22 10:12 mikel

@mikel OK, this is rebased against master. Would you like me to send a separate pull request that is against 2-8-stable?

jeremyevans avatar Dec 03 '22 16:12 jeremyevans