Re: Why rewrite QP-encoded messages when t he receiver cannot take 8BITMIME?

Sam Varshavchik <[email protected]> Sat, 29 Jun 2024 08:37:04 -0400
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
Alessandro Vesely writes:

> Sam,
>
> if you thought 8BITMIME was globally implemented, it's not.  There is a mail- 
> checking service at https://aboutmy.email/ whose server doesn't advertise  
> it.  Consequently, Courier rewrites messages, thereby breaking signatures.  
> What is puzzling is that messages are rewritten even if they are encoded.   
> Why?
>
> Hanno pointed me to the following code in rfc2045acprep.c:
>
>     case qpseeneqh:
>         curstate=quotedprint;
>         if ( (unsigned char)
>             ( (h2nyb(statechar) << 4) + h2nyb(*p) ) >= 127
>             ) currwp->has8bitchars=1;
>
> It sets has8bitchars if a char is 8 bit /after decoding it/!  Is there a  
> reason for doing so?  How about base64 encoded 8bit chars?

This was originally done to "correct" mailers that always used quoted- 
printable at the same time that there are mailer readers that did not  
implement quoted-printable, and just dumped plain text mail. This logic was  
used to figure out, when talking to a remote mail server, how the message  
can be transcoded.

Of course, message signatures came along, and blew up everything with a  
broken design. So, there we are. I'm open to proposals and patches, for a  
reasonable compromise. Note that this code serves dual purpose – to  
determine whether something needs to be mime-transcoded, or not, and then  
when push comes to shove to actually figure out how to transcode each MIME  
part.

So, probably any changes would not be here, but in the code that uses this  
logic. This specific piece of code is correct – it determines whether the  
given MIME section contains 8-bit content or not (after applying content  
transfer encoding). So, any logical changes would be elsewhere, where this  
information is used.

_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRupkKLJP96aW75pIOKYPgoojZS4gUCZn//8AAKCRCKYPgoojZS
4rGxAQDJQYVG+89ZrHMhhYFcq5/0H8X3IlTK/AVn6F7yumrcSgEA7KTZC1OOwdVM
Gu1P6092V6u6PfeQLlwF1w3nRv+bBwI=
=QVLH
-----END PGP SIGNATURE-----