summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-20 18:48:12 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-20 18:48:12 +0200
commit10e6a782863125bb522deaf32db52e46a19b958c (patch)
treec92c824a4eb1ef58d2c58a7e7287d810122bac83
parent4eff264615ea8b311184d5102bc3285b9f91c238 (diff)
downloadmblaze-10e6a782863125bb522deaf32db52e46a19b958c.tar.gz
mblaze-10e6a782863125bb522deaf32db52e46a19b958c.tar.xz
mblaze-10e6a782863125bb522deaf32db52e46a19b958c.zip
add a few example scripts
-rwxr-xr-xcontrib/mfillmid14
-rwxr-xr-xcontrib/mmairix4
2 files changed, 18 insertions, 0 deletions
diff --git a/contrib/mfillmid b/contrib/mfillmid
new file mode 100755
index 0000000..d69a2e4
--- /dev/null
+++ b/contrib/mfillmid
@@ -0,0 +1,14 @@
+#!/bin/sh
+# mfillmid - fill in files for message-ids (via mairix)
+
+exec awk '
+function q(a) { gsub("\\47", "\47\\\47\47", a); return "\47"a"\47" }
+/<..*>/ {
+	match($0, "<..*>")
+	mid = substr($0, RSTART+1, RLENGTH-2)
+	if ("mairix -r m:" q(mid) | getline file) {
+		print substr($0, 0, RSTART-1) file
+		next
+	}
+}
+{ print }'
diff --git a/contrib/mmairix b/contrib/mmairix
new file mode 100755
index 0000000..133fcfe
--- /dev/null
+++ b/contrib/mmairix
@@ -0,0 +1,4 @@
+#!/bin/sh
+# mmairix QUERY - santoku wrapper around mairix
+
+mairix -r "$@" | mless