blob: 91dc13efeb1bbf21cc5bc75d3a9eb24e6eb069e4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
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 '*!'
|