mirror of https://github.com/leahneukirchen/mblaze
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
365 B
Plaintext
17 lines
365 B
Plaintext
8 years ago
|
#!/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
|
||
|
}'
|