ietf-822
[Top] [All Lists]

Re: Content-MD5

2001-04-11 11:33:52
I think this is actually simpler than you are making it out to be, though
the wording in the MIME spec can be confusing in this regard.

for each content-transfer-encoding method there is a decoding algorithm
that unambiguously produces canonical form.  for quoted-printable, 7bit,
and 8bit this means that (non-escaped) line endings are ALWAYS decoded
as CR LF, even if it happens that the local mailbox format uses bare LF
as a line terminator.  

in the mail tools that I've written the decoding and the conversion
to local formats are separate steps.   thus encoded form is first
translated to canonical form, and (when necessary) that is then converted
to local form.  if the body part is quoted-printable, an unescaped
end-of-line in encoded form becomes CR LF in canonical form, which might
then be translated to LF in local form.

this works for all body parts regardless of content-type.

if you're generating a MIME object you should compute content-MD5 over
canonical form - i.e. over what the encoded form will produce after 
decoding.  if you happen to have botched the translation from source-local
to canonical form, it doesn't matter for the purposes of content-MD5
calculation - you need to compute MD5 over whatever octet string you 
have encoded in the body part, even if it was improperly translated
from source-local form.

Keith

<Prev in Thread] Current Thread [Next in Thread>