diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-29 15:57:02 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2016-07-29 15:57:02 +0200 |
commit | 09f3f66eb9e5006a66e4364ad20763cc2fd8161c (patch) | |
tree | b99f4952b73f0de4206a095165ed605d3eb732d6 /contrib | |
parent | 8228619e05f14b92c6e4583f750af47dab79efe6 (diff) | |
download | mblaze-09f3f66eb9e5006a66e4364ad20763cc2fd8161c.tar.gz mblaze-09f3f66eb9e5006a66e4364ad20763cc2fd8161c.tar.xz mblaze-09f3f66eb9e5006a66e4364ad20763cc2fd8161c.zip |
add contrib/malternative
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/malternative | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/malternative b/contrib/malternative new file mode 100755 index 0000000..db54841 --- /dev/null +++ b/contrib/malternative @@ -0,0 +1,16 @@ +#!/bin/sh +# malternative - multipart/alternative decoding policy + +{ + echo "Content-Type: $PIPE_CONTENTTYPE" + echo + cat +} | mshow -t /dev/stdin | awk ' + BEGIN { split("", ct) } + /^ [0-9]/ { ct[++n] = $2 } + function prefer(t) { for (i in ct) if (ct[i] == t) exit(64+i) } + END { + prefer("text/plain") + prefer("text/html") + exit 64+1 # default to first part + }' |