On Wed, Jun 14, 2017 at 12:18:44AM +0200, Vincent Lefevre wrote: > I don't think that libmagic is a good idea. It has too many false > positives; by that, I mean that it can say that some file has > some specific MIME type (e.g. text/x-c) while it is actually > just text that may have some lines of C in a small part of it. > Many bugs have been reported and most of them are still not fixed.
I agree... you're getting to the crux of my issue with all of this, but there's more... > 2. If the file is valid UTF-8 and contains no blacklisted control > characters (to be defined, but this should include null bytes), > then MIME type = text/plain. What if the attachment is 10GB? -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 -=-=-=-=- This message is posted from an invalid address. Replying to it will result in undeliverable mail due to spam prevention. Sorry for the inconvenience.
pgp8wIaGot27F.pgp
Description: PGP signature