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'm not opposed to anything you've proposed. I do wonder if we want to invoke a program before checking the file extension. The problem we're trying to address is a flawed guessing routine when the file has no known file extension. I don't recall seeing any tickets or complaints about wrong types when attaching files with extensions. Not to say it's perfect, but it is at least logical and explainable. No matter how good a program one tries to write for step 0 or step 2, it will still be a guess. I think it would be better to do that only if we can't find a known file extension. -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature