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
authormartin f. krafft <madduck@madduck.net>
Tue, 8 Dec 2020 21:02:33 +0000 (10:02 +1300)
committermartin f. krafft <madduck@madduck.net>
Sun, 12 Sep 2021 23:13:41 +0000 (11:13 +1200)
.gitignore.d/mutt
.mutt/confvars
.mutt/container-extractor [moved from .mutt/tnef-extractor with 74% similarity]
.mutt/mailcap.containers [new file with mode: 0644]

index 55ea528cd699eb014d1e4cba3018243a3e00d77d..329c30ce49d048469b9d2552eab26bf2f0d9685e 100644 (file)
@@ -11,6 +11,7 @@
 !/.mutt/bgview-fifo
 !/.mutt/colours
 !/.mutt/confvars
+!/.mutt/container-extractor
 !/.mutt/edit-header
 !/.mutt/filter-proxy
 !/.mutt/get-timestamp
@@ -23,6 +24,7 @@
 !/.mutt/list-mailboxes
 !/.mutt/lists
 !/.mutt/mailcap.backgrounding
+!/.mutt/mailcap.containers
 !/.mutt/mailcap.editing
 !/.mutt/mailcap.htmldump
 !/.mutt/mailcap.icalendar
@@ -46,7 +48,6 @@
 !/.mutt/sidebar
 !/.mutt/spam
 !/.mutt/supersede-header
-!/.mutt/tnef-extractor
 !/.mutt/viewmailattachments
 !/.var/mutt/.gitignore
 !/.var/mutt/header_cache/.gitignore
index e7d713b63a7987320b13780a04b30668438f965b..6c5883e2e35fd56959000ca4e18c1fbb10aa2ffc 100644 (file)
@@ -2018,7 +2018,7 @@ set mail_check_stats=yes
 # This variable specifies which files to consult when attempting to display MIME
 # bodies not directly supported by Mutt.
 # 
-set mailcap_path="$my_confdir/mailcap.tnef:$my_confdir/mailcap.icalendar:$my_confdir/mailcap.backgrounding:$my_confdir/mailcap.htmldump"
+set mailcap_path="$my_confdir/mailcap.containers:$my_confdir/mailcap.icalendar:$my_confdir/mailcap.backgrounding:$my_confdir/mailcap.htmldump"
 
 
 # 3.139. mailcap_sanitize
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
diff --git a/.mutt/mailcap.containers b/.mutt/mailcap.containers
new file mode 100644 (file)
index 0000000..3006186
--- /dev/null
@@ -0,0 +1,7 @@
+#
+# Mutt mailcap for dumping HTML to text
+#
+
+application/ms-tnef; ~/.mutt/container-extractor '%t'; description=Microsoft NIH TNEF
+application/x-zip-compressed; ~/.mutt/container-extractor '%t'; description=Compressed ZIP files
+application/zip; ~/.mutt/container-extractor '%t'; description=Compressed ZIP files