summaryrefslogtreecommitdiffstats
path: root/mailq-recipient
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-05-11 13:27:07 +0200
committerFlorian Pritz <bluewind@xinu.at>2013-05-11 13:27:07 +0200
commit60cb01f9a81c311f914aed4a23e8e5b35e965918 (patch)
tree8b9109a8f1bcf37506755e0e77b83b0a026cda57 /mailq-recipient
parenta9ba01279e6f3c64b082f4de6e7d95cd1b5f7dab (diff)
downloadbin-60cb01f9a81c311f914aed4a23e8e5b35e965918.tar.gz
bin-60cb01f9a81c311f914aed4a23e8e5b35e965918.tar.xz
soem more cleanup
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'mailq-recipient')
-rwxr-xr-xmailq-recipient12
1 files changed, 12 insertions, 0 deletions
diff --git a/mailq-recipient b/mailq-recipient
new file mode 100755
index 0000000..91dc13e
--- /dev/null
+++ b/mailq-recipient
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [[ -z $1 ]]; then
+ echo "Usage: ${0##*/} <recipient>"
+ exit
+fi
+
+mailq | tail -n +2 | grep -v '^ *(' | awk 'BEGIN { RS = "" }
+ # $7=sender, $8=recipient1, $9=recipient2
+ { if ($8 == "'$1'" && $9 == "")
+ print $1 }
+ ' | tr -d '*!'