about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/mhasatt9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/mhasatt b/contrib/mhasatt
new file mode 100755
index 0000000..7ae2b68
--- /dev/null
+++ b/contrib/mhasatt
@@ -0,0 +1,9 @@
+#!/bin/sh
+# mhasatt [RANGE...] - print mails with real attachments
+
+mshow -t "${@:-:}" | awk '
+	/^[^ 0-9]/ && /\// { file = $0 }
+	/^.*[0-9]*: (application\/pkcs7-signature)/ { next }
+	/^.*[0-9]*: (application|image|video)\// || /^.*[0-9]*:.*name=/
+		{ if (file) print file; file = 0 }
+'