gen-smtp / gen_smtp

The extensible Erlang SMTP client and server library.
Other
683 stars 265 forks source link

Header param encoding #310

Open juhlig opened 2 years ago

juhlig commented 2 years ago

https://github.com/gen-smtp/gen_smtp/blob/c6f25a758d60da9788bf5ddf73e985dacb28f74b/src/mimemail.erl#L924-L929

I think this is wrong (though most Mail clients seem to accept it): Parameters should be encoded according to RFC 2231, not RFC 2047.

seriyps commented 2 years ago

Oh, interesting. This change have been merged quite recently https://github.com/gen-smtp/gen_smtp/pull/235. But I think it would worth to add support for RFC-2231 (in parser as well; including multiline params)

Maria-12648430 commented 2 years ago

311 is about the encoding of parameter values. I'll see what I can do about decoding in a later PR (probably quite tricky, it looks like many clients do it wrong, so we need to be able to parse both RFC2231 and RFC2047), but I think first this PR should be carefully reviewed.

Maria-12648430 commented 2 years ago

I noticed some bugs in header parameter parsing that I need to iron out before tackling the actual decoding :disappointed: