On 2012-10-09 15:52:36 +0000, Viktor Dukhovni wrote: > The postmap(1) utility feeds the MIME parser exactly what you ask > it to process. I think this is best, it is a testing tool, not a > message normalizer.
OK, but wouldn't an error message in case of invalid message be a nice feature? > > Anyway, even without the "From " line (which was actually my first > > test, but the message was too large as an example), I don't get the > > expected behavior: > > Use bash(1) (which supports <(command args) file handles) and try > this one-liner. > > $ printf "Content-Type: multipart/mixed; boundary = > -\n\n---\nContent-Disposition: inline;\n filename = foo.txt\n\n-----\n" | > postmap -m -h -q - pcre:<(printf '/^Content-Disposition:.*filename/ > REJECT foo') > > My output is: > > Content-Disposition: inline; > filename = foo.txt REJECT foo > > If you see something else, do post the details. Otherwise, your > test is still flawed, in that you're not testing with a valid MIME > message. I see the same thing, but if I remove the "-h" option, I get no output. I wonder whether this is expected. The postmap(1) man page says: -m Enable MIME parsing with "-b" and "-h". which (after rereading it several times) I find ambiguous. This could mean either: -m Enable [MIME parsing with "-b" and "-h"]. i.e. it enables MIME parsing and one gets the effect of "-b" and "-h" options (in which case one should have got the above output), or: -m [Enable MIME parsing] with "-b" and "-h". but in this case I would have expected an error message, because -m is used without "-b" and/or "-h". -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <http://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)