mikel / mail

A Really Ruby Mail Library
MIT License
3.61k stars 936 forks source link

Parse attachment filenames when missing RFC-required quotes, for certain content-types? #1606

Open pdg137 opened 7 months ago

pdg137 commented 7 months ago

This is a continuation of #1213 which seemed to have been fixed in 2.8.1. On this version it still seems to fail in some cases, specifically if the content-type contains a period:

irb(main):001> require 'mail'
true
irb(main):002> Mail::Part.new('Content-Type: text/plain; name==?utf-8?B?dGVzdC50eHQ=?=').filename
"test.txt"
irb(main):003> Mail::Part.new('Content-Type: text/pla.in; name==?utf-8?B?dGVzdC50eHQ=?=').filename
nil
irb(main):004> Mail::Part.new('Content-Type: text/pla.in; name="=?utf-8?B?dGVzdC50eHQ=?="').filename
"test.txt"