mailio icon indicating copy to clipboard operation
mailio copied to clipboard

the mime format problem

Open lofonder opened this issue 1 year ago • 3 comments

the string_t mime::parse_header_value_attribute(const string& attr_value) const only parsed the first line of the Content-Disposition

the mime data example: ` Content-Type: application/pdf;

name*0*=UTF-8''py%E5%8E%BF%E7%BA%A7%E6%9C%BA%E6%9E%84%E7%A7%91%E6%8A%80;

name*1*=%9C%7D%E5%6A%A1%E9E7%BA%A7%E6%9C%BA%E6%9E%84%E7%E6%E6%8A%80.pdf

Content-Transfer-Encoding: base64

Content-Disposition: attachment;

filename*0*=UTF-8''py%E5%8E%BF%E7%BA%A7%E6%9C%BA%E6%9E%84%E7%A7%91%E6%8A%80;

filename*1*=%E5%9D%8D%E5%8C%E7%BA%A7%E6%9C%BA%E6%9E%84%E7%A7%91%E6%8A%80;

filename*2*=pdf

` the filename 1 and filename2 was recoginzed as the url code. is it a bug?

I think it would be better if decode the filename in the function of the mime::merge_attributes? cause I founded that the filename0 part was the nomal text decoded ,and the filename1 part was the text encoded.

lofonder avatar Jul 14 '24 08:07 lofonder

Let me check it.

karastojko avatar Jul 22 '24 19:07 karastojko

You are right, there is a bug. I am fixing it...

karastojko avatar Jul 23 '24 20:07 karastojko

Please try the latest commit. It should fix your problem although it is still not complete by the specification.

karastojko avatar Jul 28 '24 16:07 karastojko

The percent codec is implemented now for both formatting and parsing.

karastojko avatar Nov 02 '24 14:11 karastojko