jstedfast / MimeKit

A .NET MIME creation and parser library with support for S/MIME, PGP, DKIM, TNEF and Unix mbox spools.
http://www.mimekit.net
MIT License
1.84k stars 373 forks source link

Wrong encoded-word token #1079

Closed wahtherewahhere closed 2 months ago

wahtherewahhere commented 2 months ago

Hi,

There is an encoded-word-token bug that causes the failure of sending emails.

It needs to be capital Q and B in following codes: https://github.com/jstedfast/MimeKit/blob/4.7.1/MimeKit/Utils/Rfc2047.cs#L1074 https://github.com/jstedfast/MimeKit/blob/4.7.1/MimeKit/Utils/Rfc2047.cs#L1077

Thanks

jstedfast commented 2 months ago

What makes you think that?

Quoted directly from the specification:

Both 'encoding' and 'charset' names are case-independent. Thus the charset name "ISO-8859-1" is equivalent to "iso-8859-1", and the encoding named "Q" may be spelled either "Q" or "q".

wahtherewahhere commented 2 months ago

I sent mail to M365 and get bad format with lower case.

jstedfast commented 2 months ago

Can you provide me with logs?

I am surprised that any mail server out there is feeding you back an error due to the capitalization of a character in an encoded-word token seeing as how mail servers themselves do not need to decode headers.