karastojko / mailio

mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols. It is based on standard C++ 17 and Boost library.
Other
372 stars 98 forks source link

the mime format problem #170

Open lofonder opened 2 months ago

lofonder commented 2 months ago

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.

karastojko commented 1 month ago

Let me check it.

karastojko commented 1 month ago

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

karastojko commented 1 month ago

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