]> git.madduck.net Git - etc/mutt.git/blobdiff - .mutt/container-extractor

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

mailcap handler for containers
[etc/mutt.git] / .mutt / container-extractor
similarity index 74%
rename from .mutt/tnef-extractor
rename to .mutt/container-extractor
index d11d25fa74f0886c80e2c28ea95fff6f77c37935..e8dec5231955f4e2d66df609c1aa618874f0137b 100755 (executable)
@@ -13,7 +13,7 @@ for i in $LOGNAME volatile; do
   fi
 done
 export TMPDIR
-TMPDIR=$(mktemp -dp "$TMPDIR" tnef.XXXXXXXXXX)
+TMPDIR=$(mktemp -dp "$TMPDIR" cont.XXXXXXXXXX)
 cleanup()
 {
   cd / && rm -r "$TMPDIR"
@@ -23,7 +23,12 @@ cleanup()
 trap cleanup 0 1 2 3 4 5 6 7 8 10 11 12 13 14 15
 
 cd "$TMPDIR"
-tnef -v
+
+case "$1" in
+  (application/ms-tnef)            tnef;;
+  (application/x-zip-compressed)   unzip /dev/stdin;;
+  (application/zip)                unzip /dev/stdin;;
+esac
 
 nfiles=$(ls -1 | wc -l)
 if [ $nfiles -eq 1 ]; then