mailcap/content-type bug +patch

Alexander Zangerl <[email protected]> Wed, 09 Feb 2005 22:19:42 +1000
Newsgroups gmane.mail.exmh.devel
Message-ID <[email protected]>
(see <URL:http://bugs.debian.org/294212> for the full story)
exmh mangles Content-Types which contain a dot 
(like application/vnd.ms-powerpoint).

i found the problem & fixed it. the original implementation did "sanitize"
the content-type a bit too eagerly: only alphanumerics, the hyphen 
and the forward slash survived. rfc2045 is a bit more generous, and
the patch makes exmh follow rfc2045 properly.

dear upstream cvs committers: could somebody please apply that patch to
the cvs version?

regards
az

-- 
+ Alexander Zangerl + DSA 42BD645D + (RSA 5B586291)
Any sufficiently fucked-up technology is indistinguishable from magic.
 -- ?, paraphrasing Arthur C. Clarke

_______________________________________________
Exmh-workers mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/exmh-workers
mime.patch (application/octet-stream, 700 B)
--- mime.tcl.orig	Wed Feb  9 11:12:14 2005
+++ mime.tcl	Wed Feb  9 11:13:49 2005
@@ -318,9 +318,11 @@
 	set type text/plain
     }
     # Paranoia time - sanitize these just in case...
-    # Yes, we're ignoring the rfc2045 sec 5.1 definition of 'tspecials'
+    # rfc2045: any ascii char except space, controls and
+    # the tspecials: ()<>@,;:\"/[]?=
+    # the forward slash is kept.
     set mimeHdr($part,hdr,content-type) $contentType
-    regsub -all {[^-/[:print:]]} $type {} type
+    regsub -all {[[:cntrl:][:blank:]()<>@,;:\\"?=[.[.][.].]]} $type {} type
     set mimeHdr($part,type) $type
     regsub -all {[^-[:print:]]} $encoding {} encoding
     set mimeHdr($part,encoding) $encoding
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFCCf/kpy/2bEK9ZF0RAguyAJ9IBnBbvnCj1gBwxjmpZSBcIurruQCeJFaH
jnHbhkRjqgQ9s22zlqPsYeQ=
=pgOZ
-----END PGP SIGNATURE-----