Return to Snippet

Revision: 16430
at August 4, 2009 00:22 by Figjam


Initial Code
#!/bin/sh

cd /var/spool/mqueue
for i in `grep -sl "<some common phrase in the headers>" qf*`
do
	j=`ls -1 "$i" | sed 's/qf\(.*\)$/df\1/'`
	echo "Deleting $i ($j)"
	rm $i $j
done

Initial URL


Initial Description
Delete emails matching a phrase in the headers.

Initial Title
Sendmail: Delete Matching Mail

Initial Tags


Initial Language
Bash